Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expectations throw stale element exceptions but still pass #642

Closed
StephenDavidson opened this issue Sep 16, 2015 · 2 comments
Closed

Expectations throw stale element exceptions but still pass #642

StephenDavidson opened this issue Sep 16, 2015 · 2 comments

Comments

@StephenDavidson
Copy link

I have currently have an inline search that will swap elements when you search, but the page does not change. In order to wait for the search result I use an expectation for text. The waitForConditionTimeout is set.

The issue comes up, that my assertions pass, but I receive a few stale element exceptions. What is the expected behavior for this? My jenkins jobs will fail but my assertions will all pass, and I am unable to catch the stale element exception. Thanks.

proposalPage.section.firstSearchResult.expect.element('@headingText').text.to.equal('Team');

Test output:

 ✔ Expected element <.section-picker-component .button-component--primary> to be visible - condition was met in 17ms
    stale element reference: element is not attached to the page document
  (Session info: chrome=45.0.2454.85)
  (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.10.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 78 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Stephens-MacBook-Pro.local', ip: '10.228.138.86', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={userDataDir=/var/folders/gf/1fvy4m1s7x18fjl7d3g45q140000gn/T/.org.chromium.Chromium.Nls25i}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=45.0.2454.85, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: a55dd97ebe163be81e89ac5b16eeb1d8

For more information about the error run with --verbose option.
 ✔ Expected element <Section[name=firstSearchResult],Element[name=@headingText]> text to equal: "Team" - condition was met in 1924ms
@MateuszJeziorski
Copy link
Contributor

There were 2 similar issues reported. What nightwatch version do you use? The 0.8.3 contains the fix for this problem

@StephenDavidson
Copy link
Author

0.8.2, updated to 0.8.3 and it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants