Problems with Firefox WebDriver back navigation since approx 2.13.0

811 views
Skip to first unread message

B P

unread,
Mar 20, 2012, 3:05:04 AM3/20/12
to seleniu...@googlegroups.com
The most stable version of selenium-server that I could use was 2.13.0
because after that the Firefox WebDriver had some strange failures
when using back-navigation.  Particularly in areas where you submit a
form, and are given a page of results from that POST action.  You
follow a link from those results, then go BACK.  This works fine
outside of Selenium in natural IE & Firefox.  I've tried 2.19.0 &
2.20.0 but haven't tried anything else in between.

Example back-navigation that no longer works::
driver.navigate().back();
   or
driver.executeScript("history.
go(-1);", new Object[0]);

Unfortunately for me, Firefox updated itself to 11 which will
apparently not work with Selenium Server 2.13.0.   Firefox loads up
but never fully initializes.

Here is a stacktrace of Selenium IDE 1.7.1 with Selenium Server 2.13.0
on Firefox 11 & Windows 7 (64-bit).  JDK 1.6.0_30.

org.openqa.selenium.firefox.NotConnectedException: Unable to connect
to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-
local
*** LOG addons.xpi: Skipping unavailable install location app-system-
share
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-
on ID: C:\Users\MYUSER\AppData\Local\Temp
\anonymous1980214192858227672webdriver-profile\extensions\webdriver-
staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found

       at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:
95)
       at
org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:
147)
       at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
78)
       at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
126)
       at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
77)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
       at java.lang.reflect.Constructor.newInstance(Unknown Source)
       at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:
147)
       at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:
76)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:
990)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:
943)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
485)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
456)
       at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:294)
       at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
225)
       at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
291)
       at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
193)
       at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
585)
       at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
913)
       at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
464)
       at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:
139)
       at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:
83)
       at MyTestApp.main(MyTestApp.java:34)


If I upgrade my dependencies to Selenium Server 2.20.0 the application
will successfully initialize and start and run normally for a while
but the back-navigation will be broken and result in error messages
within Firefox:

Document Expired
This document is no longer available.
The requested document is not available in Firefox's cache.As a
security precaution, Firefox does not automatically re-request
sensitive documents.Click Try Again to re-request the document from
the website.

Clearly there is some sort of different caching behavior that changed
somewhere after 2.13.0 and this new behavior does not resemble natural
Firefox.  This strikes me as some sort of regression.

Is there a fix for this coming in 2.21.0 that is supposed to address a
number of Firefox stability issues?  Or is there perhaps some kind of
Profile option I can use to re-enable the caching that used to work?
I tried searching the bug tracker but didn't notice anything relevant.

Vishal

unread,
Mar 20, 2012, 11:51:35 AM3/20/12
to seleniu...@googlegroups.com
I to faced the same issue 
The workaround I applied
Keep the URL of the parent page before leaving
Parentpageurl = driver.location
Element.click
Do your validation if req 
Diver.navigate.to parentpageurl 
Instead of driver.navigate.back

-via iPhone 
Vishal mishra

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

B P

unread,
Mar 20, 2012, 12:49:19 PM3/20/12
to Selenium Users
Thanks, but it is not clear to me how this could work in a POST
scenario.
HTTP POST -> Results -> Click Link -> Back (to Results). This relies
on serving a cached results page and not resubmitting a POST.

driver.navigate().to("") is defined as a HTTP GET which shouldn't work
in this case
http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebDriver.Navigation.html#to(java.lang.String)

Again this is something that was working with FF 10 and before using
Selenium 2.13.0. Since I am able to manually use FF11 and get the
correct behavior, I suspect there must be some setting in the
Profile's Preferences that can make a difference. Currently my test
app only uses the temporary anonymous profiles, but I suppose as a
test I could export my real profile and try with that. I did,
however, look at the SVN changelogs for the Firefox package and
couldn't pinpoint anything obvious that changed since 2.13.0 that
could explain it. There were some refactorings that perhaps may have
broken things.

On Mar 20, 10:51 am, Vishal <vishal.mishr...@gmail.com> wrote:
> I to faced the same issue
> The workaround I applied
> Keep the URL of the parent page before leaving
> Parentpageurl = driver.location
> Element.click
> Do your validation if req
> Diver.navigate.to parentpageurl
> Instead of driver.navigate.back
>
> -via iPhone
> Vishal mishra
>

B P

unread,
Mar 20, 2012, 1:26:21 PM3/20/12
to Selenium Users
I exported my real profile that works outside of Selenium and loaded
it with the FirefoxDriver. But the same problem exists. I'm
convinced now that problem lies somewhere within Selenium.

B P

unread,
Mar 21, 2012, 5:09:01 PM3/21/12
to Selenium Users
After some more digging I think that a change to the
HttpCommandProcessor might have changed the behavior I was using.
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)

My best guess is that even though a GO_BACK command is defined as a
post() in the HttpCommandProcessor, maybe it needs to consult the
application cache which are defined as GET operations within Selenium
".put(GET_APP_CACHE, get("/session/:sessionId/application_cache"))"

So perhaps the change
// Do not allow web proxy caches to cache responses to "get" commands
if (httpMethod instanceof HttpGet) {
httpMethod.addHeader("Cache-Control", "no-cache");
}

Is what is causing Firefox to complain that the Document Expired / Not
Cached when doing driver.navigate().back().

If I get some spare time I'll check out 2.20.0 sources, revert r15354,
and try that.

B P

unread,
Mar 21, 2012, 8:10:55 PM3/21/12
to Selenium Users
Nope that didn't work. I'm stumped so far.

Here is a basic 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.

My point in all of this is that the natural behavior of FF with regard
to backward navigation is not working correctly via the Selenium
Remote WebDriver. It did at one time.

B P

unread,
Mar 22, 2012, 4:19:11 PM3/22/12
to Selenium Users
I've gone ahead and filed a bug report for this.

On Mar 21, 7:10 pm, B P <bap0...@gmail.com> wrote:
> Nope that didn't work. I'm stumped so far.
>
> Here is a basic example, using regular Firefox or IE, go tohttp://www.txlottery.org/opencms/Games/Scratch_Offs/Retailer_Locator.jsp

Svilen Ivanov

unread,
Mar 30, 2012, 11:11:02 AM3/30/12
to seleniu...@googlegroups.com
Hi,

I have similar problem with selenium-webdriver-2.13.0 and Firefox 11 on Linux (Kubuntu). The problem turned that webdriver's add-on (webdriver.xpi) *explicitly* requires version <= 10. You can modify it by opening the xpi file (it is regular zip file) and modifying the install.rdf file like this:

        <em:targetApplication>
            <Description>
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>3.0</em:minVersion>
                <em:maxVersion>11.*</em:maxVersion> <!-- HERE IS THE CHANGE, IT USED TO BE: 10.* -->
            </Description>
        </em:targetApplication>

Hope that helps
Svilen
Reply all
Reply to author
Forward
0 new messages