Back is returning before elements are accessible on a slowly loading page
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 718
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
I must admit, I tried to read through the Navigation section, but could not find the exact reason for my problem. I have an idea but don't know exactly why. At first here is my problem:
I have a testscript in which I execute the following steps:
create a session
set implicitWait to 0
set pageLoadTimeout to 120 seconds
go to 'http://www.page-that-takes-long-to-load.com'
click on a link
wait until the url has changed
navigate back
assert that a specific element is present
The last steps fails, because the element could not be found. If i change the testscript to:
create a session
set implicitWait to 0
set pageLoadTimeout to 120 seconds
go to 'http://www.page-that-takes-long-to-load.com'
click on a link
wait until the url has changed
go to 'http://www.page-that-takes-long-to-load.com' <-- Only this line has changed
assert that a specific element is present
The browser is able to locate the element.
I think the reason for the difference is, that the Go command waits for the navigation to complete and returns afterwards. But the Back command returns after the pageShow event was fired.
My assumption is, that the pageShow event gets fired before event A (When event A is the event that leads the wait for the navigation to complete-procedure to return).
Am I correct with that assumption?
If yes, would it be possible to add to the specification, that the remote should also wait for the navigation to complete before returning with success when executing a Back- or Forward-command?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WebDriver Navigation section and compare the Go, Back, and Forward command algorithms, especially their references to “wait for navigation to complete” and the pageshow event. Determine whether the observed difference is specified, then document the relevant behavior or prepare a specification change that defines when Back and Forward return successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100