Closed sirLisko closed 9 years ago
What exactly is the issue you're seeing (ie, is it not clicking or something else)? And can try running with --verbose
to see if that sheds an light?
Ah yes, sorry, it's not clear. Basically in the windowHandles
I get only one window.
✖ Assertion failed: there is a second window. - expected "2" but got: 1
Closing this due to lack of activity and details. Feel free to re-open if you have more data/steps to reproduce.
I pushed here https://github.com/sirLisko/nightwatch-ready a simple working version (with pause
) and I've created a branch https://github.com/sirLisko/nightwatch-ready/tree/no-pause (without pause
) in which the test fails.
The problem is that I don't think that is ideal add a pause after every click, personally I don't find it a cleaned and optimized way.
Let me know if it is still not clear enough.
@sirLisko thanks for the steps to reproduce. I see the failure with no pause but this doesn't look like a nightwatch issue (the click request is getting fired, etc) - it just takes a moment for the window to open. I guess you could write a custom command to wait on 2 windows rather than calling pause
as an improvement, but not seeing any actual issues in the nightwatch framework..
The thing is that the problem occurs also if I click an element that triggers a javascript event. Adding a pause in this case seems to me a bit overkill, but in the other hand I'm not sure what should be the best practise in this case.
@sirLisko If you came up with a clean solution for this (avoiding pause) I'm also interested.
Unfortunately I didn't find any ideal solution. At the moment I've a waitFor that checks every second if the second window is there, but it's pretty bad :(
@danielstocks please give me a shout if you find out something better.
I've got the following test:
It used to work fine literally for months, but lately it started failing and I don't have any idea about why.
I'm using the last version of
nightwatch 0.7.9
,selenium 2.46.0
andchromedriver 2.16.0
. I've also tried to rollback my code to when it used to work but it still failing. My only, and I hope temporary, solution was to add a timeout but I really don't want to add abrowser.pause(1000)
after every click.Any idea? Thanks!