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

Selenium clicks on a wrong link (or does not click at all) on certain machines #3052

Closed
lukeis opened this issue Mar 3, 2016 · 18 comments
Closed

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 3052

Hello,

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

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

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

-   Machine A: There is no click on the link at all, also there is no
error.

-   Machine B: It clicks a different link! Sometimes one above,
sometimes one below.

-   Machine C (Virtual): It works.

* I have restarted my PC, re-added the Selenium libraries - did not
help.

* The element finding mechanism works ok, "href" attribute of the found item is correct

* With "SendKeys(Enter)" it works. I cannot use it as workaround, as  this issue happened
not only to links, but to at least radio boxes as well, where "SendKeys(Enter)" does
not work.

* I have reset all IE settings and deinstalled last programs - dod not help.

All suggestions are very welcome.

Andrey


Selenium version: 2.5.0
OS: Windows XP
Browser: IE
Brower version: 8.0.6001.18702

Reported by andr.simonov on 2011-12-12 11:47:26

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This issue keeps popping up from time to time and is usually returned with request for
clarifications. The bottom line is, InternetExplorerDriver calculates coordinates of
some objects incorrectly and clicks in the wrong place. One reason for this is zoom
value other than 100%; however it is reproducible for some controls for 100% zoom as
well.

I suppose it would be helpful if you could create a sample page to demonstrate this
issue. In the meantime why don't you use Javascript click() method for offending controls?

Reported by nebehr.gudahtt on 2011-12-12 11:57:09

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Thank you, that is a very useful comment indeed.
I will try to experiment with the zoom and creating a sample page.
Andrey

Reported by andr.simonov on 2011-12-12 13:47:58

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Can you tell me how to launch IE using perl-selenium?

Reported by anuragsatishcse on 2011-12-13 09:23:40

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

It is confirmed - if I set zoom to 99% it works. Is it enough information for fix the
issue? Maybe change how Click() calculates the corrdinates, so it would not depend
on browser view %?

Reported by andr.simonov on 2011-12-13 09:53:27

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Okay, so the driver is working as documented. 

Reported by james.h.evans.jr on 2011-12-13 10:01:46

  • Status changed: WorkingAsIntended

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

James, could you please clarify - how can it be documented that driver miscalculates
coordinates sometimes?

Reported by andr.simonov on 2011-12-14 09:18:14

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Please see the project wiki for the IE driver at http://code.google.com/p/selenium/wiki/InternetExplorerDriver

Reported by james.h.evans.jr on 2011-12-14 11:36:33

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi James, I did not find exactly why the incorrent coordinate calculation is as designed.
Could you give me a quote from this doc?

Reported by andr.simonov on 2011-12-15 17:36:27

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Am I the only one waiting for James to spend his precious time on an answer? the wiki
clearly says 100% if it works with 99% the developer did not do his job and its NOT
AS DESIGNED!

Reported by asbytes on 2012-02-02 10:17:21

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

His job? Are you kidding me? We're all spending our free time on this project. You are
being incredibly rude. 

Reported by jari.bakken on 2012-02-03 08:09:07

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

so does everybody who works with this program, spending time. if he is ignoring a user's
post and just placing a wiki link even though he explained the problem fully and then
even put the bug as WorksAsIntended... I spend hours to figure out what the problem
was, before I realized its InternetExplorerDriver!!

Reported by asbytes on 2012-02-03 11:12:25

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Just to make something clear, this is an open source project.  People mostly don't get
paid for the work they do on this project. If you feel this is a bug, feel free to
download the code, open it, debug it and find the place where it fails. 

Then you can submit a patch and ask if they want to review and integrate it if this
would solve the problem. That's what most of us do. 

DUDE THEY GIVE FREE TIME FOR YOU, you should be grateful that this tool exists in the
first place so you wouldn't have to pay or develop it yourself.

Stop being rude, and keep in mind this is not his "job". Also, how much do you help
yourself if you are being rude. Do you honestly think he'll respond to you if you talk
to him like that ? 

Reported by lavoie.richard on 2012-02-03 16:07:58

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

We all do realise that it's an open source project, but this is definitely not "works
as intended".

It's not likely author wants his code to work only with 99% zoom.

Reported by andr.simonov on 2012-02-10 09:50:19

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

So you're saying it works with the zoom at 99%, but fails at 100%? That seems unlikely
to me, but I admit anything is possible. However, I will have to be convinced, which
means that I'll need a sample HTML page that reproduces the problem. Without that,
I can't reproduce it, and I have no chance of fixing it.

Reported by james.h.evans.jr on 2012-02-10 16:29:47

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi guys!

Attached you find a file that contains a small unit test and some html files.
Please extract them to a place of your choice, edit the path in the test file and run
the test.
As you can see the wrong link is being clicked.
Happy debugging. ;-)

Regards Stefan

Reported by stefan.humnig@gmx.at on 2012-03-23 20:46:45


- _Attachment: [test.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-3052/comment-15/test.zip)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Oh, so you're using frames? That's a different issue altogether. It turns out there's
some fairly complicated logic with getting element coordinates when the element in
question exists inside a frame. Clearly, there are an issue there, but that is not
the issue the original issue report describes. I have opened issue #3614 to track this
particular issue, but realize it is specific to frames and framesets, not zoom level,
and certainly not a simple page as implied by the original issue report.

Reported by james.h.evans.jr on 2012-03-24 00:26:48

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Well, at least it's a similar problem, since different zoom levels affect the link being
clicked.
Thank you for opening a new issue, I would do it myself, but C++ is not my domain.
;-)

Reported by stefan.humnig@gmx.at on 2012-03-24 07:43:47

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:14:23

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
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