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

in InternetExplorerDriver click doesn't always work #1415

Closed
lukeis opened this issue Mar 2, 2016 · 12 comments
Closed

in InternetExplorerDriver click doesn't always work #1415

lukeis opened this issue Mar 2, 2016 · 12 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 1415

What steps will reproduce the problem?
1. it's not stable so I don't know how to suggest to reproduce
2.
3.

What is the expected output? What do you see instead?
I expect click to be performed, instead nothing happens. the element is found but click
doesn't do anything.

What version of the product are you using? On what operating system?
selenium-java-2.0b2

Please provide any additional information below.
in InternetExplorerDriver when I get to some application regions, the click action
doesn't work. I have a form with search options in checkboxes, the text input gets
the sendKeys successfully but clicking on the checkbox doesn't check it (setSelected
does work) and trying to click the Search input button also does't work, but Submit
does.

sorry for not being able to supply more relevant information but it really isn't stable
enough to reproduce, and it happens in work related application so I can't direct to
to it.

Reported by hirsh.dan on 2011-03-17 11:35:51

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Please try to create a low level test case where this is reproducible to some degree.
If not, include a link to the site you were testing, with some information on the elements
in question.

Reported by antlong on 2011-03-17 15:34:56

  • Status changed: NeedsClarification
  • Labels added: OpSys-Windows, Browser-IE

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

We have noticed the same problem for the application we are testing, somehow it seems
hard to reproduce. Some of our computers running the testcode seem to miss to click
almost every time (without fail) while others only occasionally fail. The most common
time of error is when debugging our code with Netbeans. I don't know if this is just
a coincidence or if it could be interfering somehow.
our testing environment:
Ie 8, selenium-java-2.0b2 + selenium-server-standalone-2.0b2,WinXP


Reported by belgarn on 2011-03-18 07:55:01

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I believe that if you find a site with a checkbox and go to it with IE you will encounter
the same issue. it happens almost all the time with IE driver on checkboxes.
I have tried it in a number of internal applications to which I can not refer you.
P.S
the IE driver also gives me issues with clicking on some links from time to time.
should the link have a specific structure (HTML build, attributes etc.) so clicking
will work? or should it simply be an <a> tag. FF does click it successfully.

Reported by hirsh.dan on 2011-03-20 05:11:21

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

the problem I face exists on windows xp with IE8,
I have to mention that on windows 7 with IE8 it works fine.

Reported by hirsh.dan on 2011-03-21 07:21:09

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

There are a number of tests in the unit tests for the project that exercise the code
for selecting checkboxes, and these indicate no problems in IE. Therefore, it is not
a universal problem with every checkbox. Again, we will need a page that reproduces
the problem consistently in order to debug it. Note that it does not need to be a page
of the "internal application" itself; a simple html page that you have written yourself
will suffice, as long as it reproduces the problem

Reported by james.h.evans.jr on 2011-03-28 14:23:39

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

We have backed our codebase to Selenium alpha7 and have seen this behaviour there also.
It seems to some javascript that goes bad and all clicks and commands that post data
stops working. We had a stable test that always failed but we have rewritten the code
since then. But one issue that caused this was maximizing the internet explorer window
when it was already maximized.

Reported by belgarn on 2011-04-28 06:54:46

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Closing issue with status NeedsClarification for > 2 months.

Reported by jari.bakken on 2011-07-04 14:55:30

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by jari.bakken on 2011-07-04 14:57:33

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Just wanted to mention a workaround for this - if a particular element in IE8 with WinXP
resists being clicked with WebDriver's Click() method, code like this usually works
for me (in C#):

// Use SendKeys() instead of Click() to perform the click
driver.FindElement(By.Name("foo")).SendKeys(Keys.Enter);

Then, since SendKeys returns immediately, I use WebDriverWait to spin until the browser
is ready to continue.

The failed Click() behavior still happens consistently for me when trying to click
form submit buttons, in this configuration:

selenium-dotnet-2.0.0
Windows XP
IE8

Reported by billagee on 2011-07-09 17:43:14

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I also am experiencing this, using SeleniumDotNet-2.0RC. When Selenium is only using
the IE browser, the clicks always work. However when my test assembly has multiple
browsers open (Chrome + Firefox), sometimes the IE clicks do not trigger the javascript
client validation they are supposed to. The clicks always work on Chrome and FF. 

Thanks to billa for the workaround. I have created an Extension method that seems to
work when the .Click() method fails to work in IE:


        public static void ForceClick(this IWebElement element, IWebDriver browser)
        {
            if (typeof(InternetExplorerDriver) == browser.GetType())
            {
                element.SendKeys(Keys.Enter);
            }
            else
            {
                element.Click();
            }
        }

Reported by Dan.Ludwig.old@ucosmic.org on 2011-07-21 18:03:58

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I am using IE on Windows 7 via RemoteWebDriver and I occasionally get StaleReferenceElementExceptions
from time to time. The funny thing is this often occurs between two lines of code like:
WebElement el = driver.findElement(By.id("abc"));
String text = el.getText();

I mean, between these two lines of code, there are only a few milli seconds. How can
that be, that the WebElement isn't valid any long on the second line? That makes it
impossible to write stable tests with InternetExplorer. Very sad though...

Reported by alpwin8@web.de on 2012-01-26 09:21:50

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:12:30

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 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