theintern / leadfoot

A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.
Other
170 stars 25 forks source link

I am trying to run the basic code for exploring it, but it is not finiding any element on the page #188

Closed ShaliniAgrawal20 closed 4 years ago

ShaliniAgrawal20 commented 4 years ago
ShaliniAgrawal20 commented 4 years ago
define(function (require) {
    var registerSuite = require('intern!object');
    var assert = require('intern/chai!assert');
    registerSuite({
        name: 'Google',
        GoogleSearch: function () {
            return this.remote

               .get(require.toUrl('http://www.google.co.in'))  
               .setFindTimeout(5000)   
               .findbyName('q')
                .click()
                .type('test')
                .end()
               .getPageTitle()
               .then(function(text)
                                {
                                   // THIS CODE NEVER GETS EXECUTED
                                    console.log("something should be here: ");
                                    console.log("text value: ", text);
                                    // make assertions here to verify all is well.
                                })

                .end()          

        }
    });
});
ShaliniAgrawal20 commented 4 years ago

The below are the error logs:

E:\Automation Sessions\intern-3dd\InternBasic>node --inspect node_modules\intern\runner.js config=intern Debugger listening on ws://127.0.0.1:9229/f747a215-14e4-4224-b769-57d15dd4d038 For help, see: https://nodejs.org/en/docs/inspector Debugger attached. Google FAIL: GoogleSearch (0ms) TypeError: this.remote.get(...).setFindTimeout(...).findbyName is not a function at Test.GoogleSearch [as test] at <node_modules\intern\lib\Test.js:181:24> at <node_modules\intern\browser_modules\dojo\Promise.ts:393:15> at runCallbacks <node_modules\intern\browser_modules\dojo\Promise.ts:11:11> at <node_modules\intern\browser_modules\dojo\Promise.ts:317:4> at run <node_modules\intern\browser_modules\dojo\Promise.ts:237:7> at <node_modules\intern\browser_modules\dojo\nextTick.ts:44:3> at processTicksAndRejections <internal\process\task_queues.js:75:11> 1/1 tests failed 1/1 tests failed Waiting for the debugger to disconnect...

dylans commented 4 years ago

Have you tried the correct case sensitivity of findByName rather than findbyName?

ShaliniAgrawal20 commented 4 years ago

yes, i have tried with findByName also. But it is not able to locate the element.

Below error:

FAIL: GoogleSearch (19999ms) NoSuchElement: [POST http://localhost:4444/wd/hub/session/58acaa9c6a820038754a4a9e664dd524/element/%5Bobject%20Object%5D/click] no such element: Element_id length is invalid (Session info: chrome=79.0.3945.130) For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'SAL17WIN10PLP', ip: '10.85.14.142', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191' Driver info: driver.version: unknown at runRequest <node_modules\leadfoot\Session.js:88:40> at <node_modules\leadfoot\Session.js:109:39> at new Promise <node_modules\dojo\Promise.ts:411:3> at ProxiedSession._post <node_modules\leadfoot\Session.js:63:10> at Element._post <node_modules\leadfoot\Element.js:23:31> at Element.click <node_modules\leadfoot\Element.js:163:15> at Command. <node_modules\leadfoot\Command.js:680:19> at <node_modules\dojo\Promise.ts:393:15> at run <node_modules\dojo\Promise.ts:237:7> at <node_modules\dojo\nextTick.ts:44:3> at Command.target. [as click] <node_modules\leadfoot\Command.js:674:11> at Test.GoogleSearch [as test] at <node_modules\intern\lib\Test.js:181:24> at <node_modules\intern\browser_modules\dojo\Promise.ts:393:15> at runCallbacks <node_modules\intern\browser_modules\dojo\Promise.ts:11:11> at <node_modules\intern\browser_modules\dojo\Promise.ts:317:4> at run <node_modules\intern\browser_modules\dojo\Promise.ts:237:7> at <node_modules\intern\browser_modules\dojo\nextTick.ts:44:3> at processTicksAndRejections <internal\process\task_queues.js:76:11> 1/1 tests failed

jason0x43 commented 4 years ago

Since this is a usage question rather than a bug report, Stack Overflow is the best place to ask about it. I see that a question has been opened, so I'm closing this in favor of that.