You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a website is very common to have asynchronous requests to external domains which are not critical to the website execution.
Live chat services, analytics, tracing repos, static content, etc. are commonly placed in external domains.
Sometimes those async request are fired periodically from the local domain for ping purposes, and they can affect tests if they are just waiting for all ajax requests to complete.
Imagine this scenario:
Selenium instruct the browser to perform an action which is resolved via an ajax request.
The test runner enters in a waiting cycle for all ajax to complete after that.
A live chat window ping an external domain, so we have 2 requests scheduled for execution in the browser.
The browser execute the ping request but defer the one we want.
The first byte is received, the ping completed, so basically all running ajax completed.
It's time for the test runner to evaluate all ajax completion, succeeds, exits, and the next sentence in the test is performed.
The test fails.
Since the test runner, the driver and the browser run in isolated processes, other race conditions can occur in similar scenarios.
When waiting for ajax to complete I'm more interested on waiting for specific requests to the local domain, or external API domains, rather than just all requests. So it would be very useful either to restrict the WaitFor.AjaxCallsToComplete to the concrete list of domains hosting the services, or to the specific URL endpoints that I'm interested for the test.
Please vote.
The text was updated successfully, but these errors were encountered:
Assuming that you aren't constantly firing ajax requests in parallel there should be a gap where no ajax is currently in flight and so the existing method will still work.
In a website is very common to have asynchronous requests to external domains which are not critical to the website execution.
Live chat services, analytics, tracing repos, static content, etc. are commonly placed in external domains.
Sometimes those async request are fired periodically from the local domain for ping purposes, and they can affect tests if they are just waiting for all ajax requests to complete.
Imagine this scenario:
Selenium instruct the browser to perform an action which is resolved via an ajax request.
The test runner enters in a waiting cycle for all ajax to complete after that.
A live chat window ping an external domain, so we have 2 requests scheduled for execution in the browser.
The browser execute the ping request but defer the one we want.
The first byte is received, the ping completed, so basically all running ajax completed.
It's time for the test runner to evaluate all ajax completion, succeeds, exits, and the next sentence in the test is performed.
The test fails.
Since the test runner, the driver and the browser run in isolated processes, other race conditions can occur in similar scenarios.
When waiting for ajax to complete I'm more interested on waiting for specific requests to the local domain, or external API domains, rather than just all requests. So it would be very useful either to restrict the WaitFor.AjaxCallsToComplete to the concrete list of domains hosting the services, or to the specific URL endpoints that I'm interested for the test.
Please vote.
The text was updated successfully, but these errors were encountered: