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
{{ message }}
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
Platform: Java 1.6.0_26 .. 1.6.0_31
OS: Windows 7 64-bit
Firefox: 10 & 11
IE: 9
Selenium & RemoteDriver executing on same machine.
There exists some difference in back navigation on Firefox WebDriver via Java mechanisms
like
driver.navigate().back() or
driver.executeScript("history.go(-1);", new Object[0]);
That changed somewhere after Selenium 2.13.0 and can be demonstrated in 2.19.0 and
2.20.0. I haven't bothered to narrow down any versions in between.
The change has something to do with the behavior of caching of pages rendered from
a POST operation. Such that if you go to some arbitrary website, submit a form, see
the resulting page, navigate away, then navigate back you will now get a Document Expired
warning within Firefox under WebDriver. Outside of Firefox WebDriver this warning
will not occur, not even with IE WebDriver.
For example:
using regular Firefox or IE, go to
http://www.txlottery.org/opencms/Games/Scratch_Offs/Retailer_Locator.jsp
Select a city and submit. Navigate away from that page, then navigate
back in your browser. No problem. Now spawn an instance of Firefox
or IE via Selenium WebDriver and try it. Firefox will report the
Document Expired error. IE will not report any problem.
This will not occur in regular Firefox, regular IE, or WebDriver IE. So this is a
difference in FF browser behavior brought on by some change in Selenium. Using an
existing, real user profile does not solve the problem so it cannot be some kind of
profile preference setting.
I've used the FireBug extension within FF to monitor the network request/response interactions
when doing this type of navigation. As suspected, BACK will load from cache. For
whatever reason FF WebDriver will not cache it, and it is unclear how to re-enable
that behavior.
I've tried examining commits to look for anything suspicious and the best I could come
up with is:
r15354 "DanielWagnerHall for yurodivuie: Don't allow caching of GET
commands" (http://code.google.com/p/selenium/source/detail?r=15354&path=/trunk/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java)
The code looks as if GO_BACK commands are represented as internal POST methods though,
but I'm not sure how that might affect a potential GET from cache. I've reverted that
change locally and it didn't fix the problem...
The only clue I have to go on is that FF WebDriver's warning message (see screenshot).
Maybe org.openqa.selenium.remote.server.DriverServlet? A change committed r15330 on
12/31/11 (which is consistent with the timeline of when Selenium was known to be working
and known to be broken 2.13 v.s 2.19)
// Make sure our browser-clients never cache responses.
response.setHeader("Expires", "Thu, 01 Jan 1970 00:00:00 GMT");
response.setHeader("Cache-Control", "no-cache");
The commit message neglects any mention of a change to cache control.
...So maybe somewhere there was a change that is marking the document as already expired
or something even when it wouldn't ordinarily be.
I realize there is debate about the appropriateness in caching of POST responses and
what not, however, the point here is that WebDriver is not emulating normal Firefox
behavior.
In my case everything was working fine under FF10 & Selenium 2.13.0 but unfortunately
FF11 auto-installed and is not working with Selenium 2.13.0. I've stayed away from
modern Selenium versions because of this problem, but now I have no choice.
Originally reported on Google Code with ID 3611
Reported by
bap0679on 2012-03-22 20:16:21- _Attachment: SeleniumBackNavigationDocExpired.png
_