If we send a request on /execute/sync endpoint and it returns the below response:
Response 404 POST /session/820fa3e285be4a9b4419478cb341447c/execute/sync (10ms)
{
value: {
error: 'stale element reference',
message: 'stale element reference: stale element not found\n' +
' (Session info: chrome=120.0.6099.129)',
stacktrace: ''
}
}
Then Nightwatch exits with the below error (while the browser stays open):
Error
unhandledRejection: stale element reference: stale element not found
(Session info: chrome=120.0.6099.129)
StaleElementReferenceError: stale element reference: stale element not found
(Session info: chrome=120.0.6099.129)
at Object.throwDecodedError (/Users/priyansh/Projects/test_projects/create-nightwatch-demo/yyyy/node_modules/selenium-webdriver/lib/error.js:524:15)
at parseHttpResponse (/Users/priyansh/Projects/test_projects/create-nightwatch-demo/yyyy/node_modules/selenium-webdriver/lib/http.js:601:13)
at Executor.execute (/Users/priyansh/Projects/test_projects/create-nightwatch-demo/yyyy/node_modules/selenium-webdriver/lib/http.js:529:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Driver.execute (/Users/priyansh/Projects/test_projects/create-nightwatch-demo/yyyy/node_modules/selenium-webdriver/lib/webdriver.js:745:17)
It should be noted that the error is handled properly if it happens on some /elements endpoint, like below:
# Request/Response
Request POST /session/a3c2b6a1f32d8e288b366f25eec95c54/element/3ACAFAB1F78948D78EE676688D83C048_element_8/elements
{ using: 'css selector', value: 'option[value =Mission]' }
Response 404 POST /session/a3c2b6a1f32d8e288b366f25eec95c54/element/3ACAFAB1F78948D78EE676688D83C048_element_8/elements (12ms)
{
value: {
error: 'stale element reference',
message: 'stale element reference: stale element not found\n' +
' (Session info: chrome=120.0.6099.129)',
stacktrace: ''
}
}
Description of the bug/issue
If we send a request on
/execute/sync
endpoint and it returns the below response:Then Nightwatch exits with the below error (while the browser stays open):
It should be noted that the error is handled properly if it happens on some
/elements
endpoint, like below:gives following handled error/failure:
Steps to reproduce
Sample test
Command to run
No response
Verbose Output
Nightwatch Configuration
No response
Nightwatch.js Version
latest
Node Version
No response
Browser
No response
Operating System
No response
Additional Information
No response