Selenium clicks on the wrong link (or doesnโ€™t click on the link at all) on certain machines

I am using Selenium WebDriver 2.5.0 (tried 2.13.0, this did not help). I am trying to click on a link like this:

driver.FindElement(By.PartialLinkText("Customer - Creation").Click();

Before this worked, but I tried to run the scripts after 3 weeks and I observe 3 different behaviors on 3 machines:

  • Machine A: There is no link to the link at all, also no error.

  • Machine B: she clicks another link! Sometimes one is higher, sometimes one is lower.

  • Machine C (virtual): it works.

I did not fully test this (spent half a day today), but did anyone come across this behavior?

I restarted my computer, re-added the Selenium libraries. "SendKeys (Enter)" helps, but this problem is not only related to links, but at least with radio boxes where "SendKeys (Enter)" does not work.

Share your thoughts.

Refresh . Browsers are the same on at least 2 machines, Internet Explorer 8.0

+5
source share
5 answers

Answered by nebehr.g ... @ gmail.com on Selenium Issues:

. , InternetExplorerDriver . , 100%; 100% .

, , , . , javascript click() ?

http://code.google.com/p/selenium/issues/detail?id=3052

+5

, https://code.google.com/p/selenium/issues/detail?id=3052. ...

, - , OP ! :

  • InternetExplorerDriver. IE 9, Chrome, Firefox IE 8.
  • Selenium, -, , .

, . :

  • InternetExplorerDriver ( 2.47.0)
  • .
  • 100%.
  • move_by_offset click() WebDriver.

, DID JavaScript WebDriver click(). Python, :

driver.execute_script("jQuery('{}').click();".format(css_selector))

, "" Selenium WebDriver, "css_selector" - , , , jQuery.

+1

, HTML, . , , . , (, ), . , Selenium - . , , .

0

FireFox. 100%, xpath, , . , , browerwindow!

code: (python api)

   self.driver.maximize_window()
0

All Articles