Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

WebDriver element.click() randomly hangs on Firefox 17 but not 15 or 4 #4814

Closed
lukeis opened this issue Mar 4, 2016 · 35 comments
Closed

WebDriver element.click() randomly hangs on Firefox 17 but not 15 or 4 #4814

lukeis opened this issue Mar 4, 2016 · 35 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 4814

Python example of the test:

element = self.driver.find_element_by_id('login-button')
print 'About to click...'
element.click()
print 'Done clicking.'

This will randomly hang on the click() call and the output is:
About to click...

The "login-button" triggers a form submit. The submit does happen and the browser redirects
to the home page as intended. But the test hangs on the element.click() line.

Run it over and over and sometimes it will pass and output:
About to click...
Done clicking.

When it does hang, most times if you manually refresh the browser page the test will
continue as if everything is okay. Seems like something in the click() doesn't realise
that the click happened.

Works fine on Firefox 4 and 15.01
I believe it worked on 16 but can't confirm.

Selenium version: 2.26.0
OS: Windows 7 and Salix OS (Slackware)
Browser: Firefox
Browser version: 17

Reported by redcoelho77 on 2012-11-22 20:39:54

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This is also happening with me using Selenium 2.25.0, Firefox 17 and Ubuntu

Reported by fr0wleet on 2012-11-23 20:44:30

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Fixed by r18184

Reported by barancev on 2012-11-24 09:39:27

  • Status changed: Fixed
  • Labels added: Browser-Firefox
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4813 has been merged into this issue.

Reported by barancev on 2012-11-24 09:40:19

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4807 has been merged into this issue.

Reported by barancev on 2012-11-24 09:40:54

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I still have the same problem as issue 4813, except i am using Selenium 2.26 and FF
driver 2.26 with FF 17.

Comment #2 says it's fixed, but i was wondering on wich release? Maybe i did something
wrong but i'm still having the hangout on :

driver.findElement(By.className("non_existing_class"));

as shown in issue 4813.

Reported by turambardagnir on 2012-11-26 18:13:01

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

The fix will be available in 2.27

Reported by barancev on 2012-11-27 07:36:07

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Ok thx, Do you have any idea when this release will be available?

Reported by turambardagnir on 2012-11-27 13:07:26

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4832 has been merged into this issue.

Reported by barancev on 2012-11-28 09:24:43

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Is it worth it to start adding some 'skipIf selenium < 2.27.0' calls to a test suite,
or is 2.27 looking like it is close to release?

I'm trying not to badger, if the answer is 'no idea' then I can just add the skips.
Also if there is a more central place to see progress towards 2.27 maybe linking to
it here would stop these questions.

Reported by medwards@walledcity.ca on 2012-11-28 10:10:29

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Just don't upgrade test lab to FF17 until 2.27 will be available.

As to "when" question -- there is another case where FF17 hangs, and we are going to
fix it before we ship 2.27. How long can it take? No idea, but we do the best we can
 :)

Reported by barancev on 2012-11-28 10:49:49

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Thats a good workaround for many people. Just as an FYI it isn't
feasible for many people, for example many open source projects using
Travis-CI, or businesses that have specifically tried to avoid
building test lab infrastructure and use hosted CI like Travis or
Circle.

That being said, appreciate the effort, and I hope to be getting my
hands dirty helping fix defects like these in due time.

Reported by medwards@walledcity.ca on 2012-11-28 10:53:35

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4834 has been merged into this issue.

Reported by barancev on 2012-11-28 18:54:46

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4837 has been merged into this issue.

Reported by barancev on 2012-11-29 09:44:49

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

The bad thing about this is that it's not that easy to keep Firefox from upgrading when
you don't have enough access to CI server. We're running Ubuntu and I tried to set
up no-update Firefox profile options but it still updates to 17 (I'm not sure if it's
forced by apt as 16 has critical security flaw, but still).

I current try to prevent it from upgrading by setting:
    profile['app.update.auto'] = false
    profile['app.update.enabled'] = false

What else can I do to prevent Firefox from upgrade?

Reported by p0deje on 2012-11-29 10:09:42

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Travis-CI users can get FF16 using a few lines of shell commands. I'm not sure about
p0deje's problem which I have not replicated:

# Remove after 4814 is resolved
# http://code.google.com/p/selenium/issues/detail?id=4814
wget http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/16.0/linux-i686/en-US/firefox-16.0.tar.bz2
tar -xjf firefox-16.0.tar.bz2
export PATH=./firefox:$PATH

Reported by medwards@walledcity.ca on 2012-11-29 15:48:12

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

For Travis it's ok since VM is reset after each test.

But I have dedicated Ubuntu server with Jenkins and after some test is run, Firefox
updates from 16 to 17. Thus, all subsequent builds start to fail.

Reported by p0deje on 2012-11-29 15:56:37

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4844 has been merged into this issue.

Reported by barancev on 2012-12-04 11:06:25

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 4836 has been merged into this issue.

Reported by barancev on 2012-12-04 11:07:17

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

So, could anybody say, in what versions of firefox this fix in 2.27 will be work?

Reported by Petr.Nuzhnov on 2012-12-10 13:25:25

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I'm using:

Firefox: 17
Selenium: 2.27.0 (pip install selenium==2.27.0 --force)
Windows Server 2012

and it's working.

Before, I used Selenium 2.26 and had button clicking problem.

Thank you everyone!!

Reported by nattanicha on 2012-12-11 03:58:10

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I'm using:

Firefox 17
selenium-java: 2.27.0

which can be found on http://search.maven.org

Thanks for fixing it!

Reported by r.sporny on 2012-12-11 14:14:57

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hey, guys.

Just updated to 2.28 via PIP without success.
Testing is simple:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get('http://google.com')
driver.find_element_by_id('void')

Endless wait. The expected behaviour was a NoSuchElement exception thrown.
Sad about it. Thanks in advance.

Reported by evandrofranco on 2012-12-14 02:11:54

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Just realized that PIP wasn't overwriting the correct path. I was stuck on 2.26. Removed
all legacy files and did a fresh new installation with easy_install. Work'd like a
charm. You are wonderul! Nice work, again.

Reported by evandrofranco on 2012-12-14 17:39:36

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 5159 has been merged into this issue.

Reported by barancev on 2013-02-13 17:37:35

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I still face this issue: FF20 + WebDriver 2.32 + Ubuntu

Reported by nadia.yekutiel@kenshoo.com on 2013-04-29 11:03:23

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This issue is still present in Webdriver 2.32 I have seen it on FF20 and IE9 running
on windows 7 , I am using python bindings , python version 2.7.4

Reported by adrian_upton@yahoo.co.uk on 2013-05-02 09:35:40

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Saying "the issue is still present" is saying nothing unless you provide an executable
reproduction sample.

Reported by barancev on 2013-05-02 16:59:16

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

What do mean exactly by executable reproduction sample ?

Here is what I am doing via webdriver:

I log into a production website  I am trying to click on a link in the website
that opens a windows modal dialogue .. which is handled by an AutoIT script.
The behaviour is the  modal dialogue appears but the click never returns.

My script works fine with Chrome and IE 10 on Windows 8 

Heres the Html I'm trying to work with:

<div class="GK40RFKDGJ sd-send-upload-button-panel">
<span class="gwt-InlineHTML sd-send-upload-button">your desktop</span>
<input class="GK40RFKDHJ sd-send-upload-fileupload" type="file" name="Filedata" multiple="">
</div>

link = self.browser.find_element_by_css_selector("div.GK40RFKDGJ")
link.click()

I can work around the issue by setting a socket timeout - this is not ideal:

try:
   socket.setdefaulttimeout(timeout)
   link.click()
except socket.timeout:
       print "Click timed out - continuing anyway"
else:
    print "Successfully Clicked without timeout"
finally:
    socket.setdefaulttimeout(None)





Reported by adrian_upton@yahoo.co.uk on 2013-05-03 10:08:09

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

"Executable reproduction sample" means a piece of the code in any programming language
that can be compiled and executed, and a sample page including all relevant CSS and
JS code required to reproduce the issue.

Reported by barancev on 2013-05-09 15:44:32

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hi. I'm coding a short C# application that runs Webdriver 2.37 script to test EXT.NET
based portal application in Firefox 25.0. The execution gets lock up quite frequently
at the same point when it clicks the button to roll out short menu with Sign-out button.
If I'm step-by-step debugging the code, it works fluently, but if I let it go all at
once it gets frozen. No matter if debug or release mode.

I can't provide you with entire script, but here is portion of the code:
// Sign out
driver.SwitchTo().DefaultContent();
WaitForElementPresent(By.XPath("//table[@class='x-toolbar-right-ct']"), 4);       
  WaitForElementPresent(By.XPath("//table[@id='cphShellContent_Header1_btnLoginUser']/tbody/tr[2]/td[2]/em/button"),
4);

*** THIS IS THAT CLICK ACTION THAT LOCKS UP ALL, PREVENTING MENU FROM DISPLAYING ***
driver.FindElement(By.XPath("//table[@id='cphShellContent_Header1_btnLoginUser']/tbody/tr[2]/td[2]/em/button")).Click();
            wait.Until(ExpectedConditions.ElementExists(By.XPath("//div[@id='cphShellContent_Header1_Menu1']/ul/li[2]/a[@id='cphShellContent_Header1_btnSignOut']")));
action.MoveToElement(driver.FindElement(By.XPath("//div[@id='cphShellContent_Header1_Menu1']/ul/li[2]/a[@id='cphShellContent_Header1_btnSignOut']"))).Build().Perform();

driver.FindElement(By.XPath("//a[@id='cphShellContent_Header1_btnSignOut']/span")).Click();

// close all
driver.Close();

***
Webdriver 2.37
NUnit 2.6.3
Firefox 25.0
Visual C# 2010 Express

Reported by pavol.kianicka on 2013-11-13 08:28:39

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

am seeing the exact same issues as mentioned above
was using the following setup
Firefox 25.0, 
NUnit 2.6.2,
WebDriver 2.37
Visual Studio 2010.

Problems started about a week ago on a portion of our website that has been working
well for several months - no code changes were seen dealing with any aspect of that
page so it's nothing added into product. I thought it may have been Selenium 2.37 so
I rolled back to 2.35 and same issues. I also did not have windows updates turn on
so it's nothing with the environment changing.

Am stumped... basically it does the click action and then page freezes. If I stop debugging
then the page resumes loading.

Reported by Zechtitus on 2013-11-22 21:25:14

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Zechti - this sounds like exactly the same as the problem I had. I was able to resolve
it, but it required tweaking the Selenium source. See here, https://code.google.com/p/selenium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&groupby=&sort=&id=5441

Reported by acarlonvsn on 2013-11-24 22:07:58

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Zechti - if you refer to the thread I mentioned above, you will also see that there
is now a post that Firefox version 25 is not currently supported (as per Git history).

Reported by acarlonvsn on 2013-11-29 21:37:13

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Zechti, see my update here: http://stackoverflow.com/a/20181669/746754 with the heading
"Update 25th Feb 2014". This has been solved in .NET webdriver bindings 2.40. The fix
is the same as my workaround, so if my workaround worked for you, then 2.40 should
as well. 

Reported by acarlonvsn on 2014-02-24 22:53:11

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:16:25

  • Labels added: Restrict-AddIssueComment-Commit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant