Cannot read property 'url' of undefined in Nightmare.js
See original GitHub issueWhat are you trying to achieve?
I am trying go to another page using I.amOnPage(url)
.
In my test my steps are:
I.amOnPage(url); // this amOnPage works fine
I.checkOption(element);
I.amOnPage(anotherUrl); // this one doesn't
What do you get instead?
There error I get is
Cannot read property 'url' of undefined
I have narrowed it down to the amOnPage
function in Nightmare.js file in codeceptjs/lib/helper/Nightmare.js
.
return this.browser.goto(url, headers).then((res) => {
this.debugSection('URL', res.url);
this.debugSection('Code', res.code);
this.debugSection('Headers', JSON.stringify(res.headers));
});
the res
being returned from the promise is coming back as undefined
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Cannot read property 'url' of undefined in Nightmare.js #528
I am trying go to another page using I.amOnPage(url). ... Cannot read property 'url' of undefined in Nightmare.js #528.
Read more >Nightmare with Mocha: Uncaught TypeError: Cannot read ...
I'm trying to run an example test with Nightmare.js and Mocha, and I keep getting the error ...
Read more >Cannot read property 'url' of undefined in Nightmare.js
Cannot read property 'url' of undefined in Nightmare.js. ... I am trying go to another page using I.amOnPage(url) . In my test my...
Read more >Trying to extract data from search results using Nightmare.js ...
Trying to extract data from search results using Nightmare.js, but issues an error: “CANNOT READ PROPERTY 'CLICK' OF Undefined”.
Read more >Cannot read property 'url' of undefined when starting server.js ...
Getting this error when running server.js. Started http server. info - socket.io started node.js:201 throw e; // process.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, I found this problem on version 1.0.2
PS C:\Users\fatih\Desktop\desktopp\amazon-test> npx codeceptjs run CodeceptJS v3.1.3 Using test root “C:\Users\fatih\Desktop\desktopp\amazon-test”
login – Error: Can’t connect to WebDriver. Error: Failed to create session. Unable to connect to “http://localhost:4444/wd/hub”, make sure browser driver is running on that address. If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
Please make sure Selenium Server is running and accessible × Hatali Kullanici Girisi in 23ms
– FAILURES:
at Step.run (node_modules\codeceptjs\lib\step.js:66:47) at C:\Users\fatih\Desktop\desktopp\amazon-test\node_modules\codeceptjs\lib\actor.js:116:23
Scenario Steps:
FAIL | 0 passed, 1 failed // 70ms Run with --verbose flag to see complete NodeJS stacktrace