Selenium WebDriver ElementNotVisibleError with IE 10 on Browserstack

258 views Asked by At

I have rspec tests using Capybara which work great locally and on browserstack with a configuration of OS X Mavericks/Chrome 33 on browserstack.

When I change the configuration to Windows 7 / IE 10 I'm getting an ElementNotVisibleError on the last line of code represented here:

  find('#myIdToExpandMyList').click
  #click selected one
  find(:xpath, "//SomeXPATHToRepresentAValueInMyList", :visible => :all).click

What is happening (I can see due to screenshots) is that the first line of code is not working. For some reason the click on this element is not working.

Here is an image of the expand (+)Press the plus to expand

When the user clicks on the plus sign the items in the list appear. Since the click isn't working the items never appear and the last line of code above doesn't work. Why doesn't this find/click work in IE 10 (with Selenium Webdriver)?

Here is the html code behind the expand:

<a id="myIdToExpandMyList" href="javascript:SomeJavscriptCallToExpandWithValues(params)">
  <img src="plussign.png" alt="Expand">
</a>

UPDATE: In looking at this further this appears to be related to modal dialogs. In my case I have a modal dialog opening (z-index is set and the rest of the page is not reachable). For some reason (only in IE) I can't click on a link on the modal dialog using a capybara find(element).click. It seems to find the element otherwise I believe I would get an error on that.

Second UPDATE: After trying all sorts of things (falling back to selenium, different IE versions, native clicks, nothing worked. The only thing that worked was executing the javascript via execute_script. The plus sign (href) triggers a javascript function which opens the list - I called it directly. I do not like this solution so hopefully someone has a better one.

1

There are 1 answers

1
Nishant Panchal On

I am replying on behalf of BrowserStack.

I understand for your tests on IE 10, the logs show that the expand(+) button was clicked successfully. However, the click did not initiate the action (expand menu) it was supposed to. Thus, the subsequent actions failed.

As you have mentioned, you are able to run tests locally on your machine. Could you drop us an email with following details:

  1. IEDriver version you use locally
  2. Exact version of the IE browser you test on
  3. Selenium Jar version