Issue 3592 in selenium: Intermittent XPath finding failure on Firefox --- version 2.20.0

13 views
Skip to first unread message

sele...@googlecode.com

unread,
Mar 20, 2012, 2:21:23 PM3/20/12
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3592 by RJZo...@gmail.com: Intermittent XPath finding failure on
Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

This problem seems eerily similar to a bug that was supposedly fixed about
a year ago (see Issue 2099).

I have attached an exact copy of my Java code.

What the code does:

1. Go to this URL: http://statsheet.com/mcb/teams/stats
2. Select and click the button that reads, " -- Select a Team -- "
3. Select and click the option "Arkansas-Little Rock Trojans"
4. Select and click the button that reads, " -- Select another season -- "
5. Select and click the option "2010-2011"
6. Select and click the tab that reads, "Team Stats"

// At this point the URL is:
http://statsheet.com/mcb/teams/arkansas-little-rock/team_stats?season=2010-2011

7. Select and print to the console the text on the Team Stats tab (the text
is, of course, "Team Stats").

This works about half of the time. When it works, the code prints the text
Team Stats to the console. When it doesn't work, it says it cannot find the
XPath. Same XPath, same code, random results.

So, the bug is intermittent. I ran the code 11 times without modification
(i.e. no code changes, no different steps, etc.). I made a note after each
attempt. My notes are below.

Attempt #1: The code works! Team Stats successfully printed to the
console.
Attempt #2: Error: “Unable to locate element:
{“method”:”xpath”,”selector”: … … …
Attempt #3: Error: “Unable to locate element:
{“method”:”xpath”,”selector”: … … …
Attempt #4: Error: “Unable to locate element:
{“method”:”xpath”,”selector”: … … …
Attempt #5: Error: “Unable to locate element:
{“method”:”xpath”,”selector”: … … …
Attempt #6 It works!
Attempt #7: Error: “Unable to locate element:
{“method”:”xpath”,”selector”: … … …
Attempt #8: It works!
Attempt #9: It works!
Attempt #10: It works!
Attempt #11: Error: “Unable to locate element:
{“method”:”xpath”,”selector”: … … …

Important note: I wrote another program, similar to the one above, that
works 100% of the time. It is exactly the same except that it skips steps
1-6 (see above) of the buggy code and goes straight to
http://statsheet.com/mcb/teams/arkansas-little-rock/team_stats?season=2010-2011
where it successfully uses the same XPath and prints to the console the
text: Team Stats. Again, note that the buggy code is also able to do this
about half of the time.


Selenium version: 2.20.0
OS: Mac OS X
Browser: Firefox
Browser version: 11.0

Additional details
os.arch: x86_64
os.version: 10.7.3
java.version: 1.6.0_29
I am using Eclipse.

I would be happy to provide more details on this very frustrating bug -- I
can be reached at rjz...@gmail.com.

Thanks,
Ryan

Attachments:
Exact code that results in bug.txt 2.1 KB

sele...@googlecode.com

unread,
Mar 22, 2012, 2:17:53 PM3/22/12
to selenium-develope...@googlegroups.com
Updates:
Status: NeedsClarification

Comment #1 on issue 3592 by kristian...@gmail.com: Intermittent XPath

finding failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

Intermittent bugs should be retried with 2.21 since we've fixed some
general sources of intermittent issues. Please test with 2.21 and report if
this problem still exists.

sele...@googlecode.com

unread,
Mar 24, 2012, 1:25:01 PM3/24/12
to selenium-develope...@googlegroups.com

Comment #2 on issue 3592 by RJZo...@gmail.com: Intermittent XPath finding
failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

Is 2.21 currently available? When I change my POM.XML file so that it reads
2.21 instead of 2.20, I get an error. I'm still a beginner when it comes to
POM.XML files, but I don't get the error when I write 2.19 or an earlier
version. So my guess is that 2.21 is not yet available, or else I am doing
something wrong. Please advise.

sele...@googlecode.com

unread,
Apr 14, 2012, 5:07:05 PM4/14/12
to selenium-develope...@googlegroups.com

Comment #3 on issue 3592 by kristian...@gmail.com: Intermittent XPath
finding failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

It does, now

sele...@googlecode.com

unread,
May 9, 2012, 7:08:15 AM5/9/12
to selenium-develope...@googlegroups.com

Comment #4 on issue 3592 by barancev: Intermittent XPath finding failure on
Has the issue gone away?

sele...@googlecode.com

unread,
May 9, 2012, 7:09:15 AM5/9/12
to selenium-develope...@googlegroups.com
Updates:
Labels: Component-WebDriver Browser-Firefox

Comment #5 on issue 3592 by barancev: Intermittent XPath finding failure on
(No comment was entered for this change.)

sele...@googlecode.com

unread,
May 9, 2012, 11:40:44 AM5/9/12
to selenium-develope...@googlegroups.com

Comment #6 on issue 3592 by RJZo...@gmail.com: Intermittent XPath finding
failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

I haven't been able to test it because I've been unable to get the 2.21
libraries through my Eclipse Maven plugin (I get an error). I'm going to
try to download all of the necessary libraries manually in about a week
when I know I will have time, and so I'll test it then.



sele...@googlecode.com

unread,
Jun 4, 2012, 1:14:37 PM6/4/12
to selenium-develope...@googlegroups.com

Comment #7 on issue 3592 by barancev: Intermittent XPath finding failure on
Any updates of the status? Is this still an issue?

sele...@googlecode.com

unread,
Jun 4, 2012, 11:55:01 PM6/4/12
to selenium-develope...@googlegroups.com

Comment #8 on issue 3592 by RJZo...@gmail.com: Intermittent XPath finding
failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

I tried it a few minutes ago, using version 2.22.0, and unfortunately I
encountered the bug again. I tried the code 11 times, and the code failed
twice (at random).

Note: the website referred to in the code above has changed slightly. The
site changed its html structure a tiny bit, and I had to modify the XPath
values accordingly (I ran the code 11 times after updating the XPaths, of
course). Please let me know if you would like for me to pass on the updated
XPath/code, as I would be happy to do so.



sele...@googlecode.com

unread,
Jun 5, 2012, 1:51:28 AM6/5/12
to selenium-develope...@googlegroups.com

Comment #9 on issue 3592 by barancev: Intermittent XPath finding failure on
I bet your code suffers from the missing waits.

Please try to add the following line (immediately after driver
initialization) to specify implicit waits, and see if it helps:

driver.manage().timeouts().implicitlyWait(10,
java.util.concurrent.TimeUnit.SECONDS);

sele...@googlecode.com

unread,
Jun 6, 2012, 1:59:33 PM6/6/12
to selenium-develope...@googlegroups.com

Comment #10 on issue 3592 by RJZo...@gmail.com: Intermittent XPath finding
failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

I added the code that you mentioned and ran the program 3 times. The first
two times Firefox crashed before the program was able to finish, and the
following text was output to the console:

Exception in thread "main"
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating
with the remote browser. It may have died.
Build info: version: '2.22.0', revision: '17049', time: '2012-05-29
13:32:46'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.3',
java.version: '1.6.0_31'
Driver info: driver.version: RemoteWebDriver
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:453)
at
org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:226)
at
org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:311)
at org.openqa.selenium.By$ByXPath.findElement(By.java:343)
at
org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:218)
at
com.instarta.selenium.bug.test.twenty.two.zero.SeleniumBugWithWaits.main(SeleniumBugWithWaits.java:42)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to
http://127.0.0.1:7055 refused
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:150)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:575)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at
org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:320)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:281)
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:128)
at
org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:289)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:431)
... 5 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:529)
at
org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
... 15 more


The third time the program output the text as expected, but then gave me
an error at the very end that read: "Command failed to close cleanly.
Destroying forcefully (v2).
org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@45c3987"



sele...@googlecode.com

unread,
Dec 11, 2012, 8:11:38 AM12/11/12
to selenium-develope...@googlegroups.com

Comment #11 on issue 3592 by sant...@gmail.com: Intermittent XPath finding
failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

This is still happening with 2.27 running with Jenkins

sele...@googlecode.com

unread,
Feb 21, 2013, 3:25:03 PM2/21/13
to selenium-develope...@googlegroups.com

Comment #12 on issue 3592 by dan.mop...@gmail.com: Intermittent XPath
finding failure on Firefox --- version 2.20.0
http://code.google.com/p/selenium/issues/detail?id=3592

Same problem here, I'm using selenium 2.30 and TestNG 5.14.6
Im getting an error every time i ran my xml suite.
Already inserted some timewaits but it its realy hard to have timewaits in
every "driver.findElement" element i need to do.
Strangely it get worse when i run a big test, up to 10% of my tests fails.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sele...@googlecode.com

unread,
Oct 18, 2013, 9:14:56 AM10/18/13
to selenium-develope...@googlegroups.com
Updates:
Status: WorkingAsIntended

Comment #13 on issue 3592 by barancev: Intermittent XPath finding failure
Back to the past, traiging old issues :)

The comment #6 reads that the issue is fixed by adding an implicit wait. So
all works as expected.

>> but then gave me an error at the very end that read: "Command failed to
>> close cleanly. Destroying forcefully (v2).
>> org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@45c3987"

It is not critical, just an info from the process manager.

As for the "Connection to http://127.0.0.1:7055 refused" -- it's a
completely different issue.
Reply all
Reply to author
Forward
0 new messages