title: Running Capybara tests against Internet Explorer via Browserstack
body: <p>I have a Rails app with a suite of Cucumber tests that run via Capybara on a headless Chrome browser. I'd like to find a way of running these tests (or at least a subset of them) on IE11, and have turned to Browserstack as it seems they offer the means to do this.</p>
  <p>I've successfully configured Browserstack to tunnel into my machine and run my tests but they fail on the one browser I care about - IE11.</p>
  <p>My suite is currently falling over at the login page. I'm able to do a screenshot and establish that the page is in fact rendered. I'm able to execute:</p>
  <pre><code>fill_in 'Email', with: 'mr.jones@example.com'
  </code></pre>
  <p>without error, although a screenshot then shows nothing to have been filled in. Executing</p>
  <pre><code>click_on 'Sign in'
  </code></pre>
  <p>yields:</p>
  <pre><code>'Selenium::WebDriver::Error::ElementNotInteractableError: Received a JavaScript error 
  attempting to click on the element using synthetic events. We are assuming this is 
  because the element isn't displayed, but it may be due to other problems with executing 
  JavaScript.'
  </code></pre>
  <p>I briefly experimented with <code>send_keys</code> to try and fill in the form, but to no avail. In short, it seems I can navigate to pages and find elements, but I can't interact with them.</p>
  <p>Does anyone know of a way to achieve what I'm attempting here? I'm hoping there's e.g. some setting on the driver that will make it work.</p>
  <p>I only need to be able to test a few key workflows against IE, so even if a radically different approach is needed in my testing, I won't need to rewrite the entire suite.</p>
  <p>Here is my current Capybara configuration:</p>
  <pre><code>  caps = Selenium::WebDriver::Remote::Capabilities.new
    caps['browser'] = 'IE'
    caps['browser_version'] = '11.0'
    caps['os'] = 'Windows'
    caps['os_version'] = '10'
    caps['resolution'] = '1024x768'
    caps['browserstack.local'] = 'true'
  
    Capybara.register_driver :browserstack_ie do |app|
      Capybara::Selenium::Driver.new(
        app,
        :browser =&gt; :remote,
        :url =&gt; &quot;http://#{ENV['BROWSERSTACK_USER']}:#{ENV['BROWSERSTACK_KEY']}@hub-cloud.browserstack.com/wd/hub&quot;,
        :desired_capabilities =&gt; caps
      )
    end
    Capybara.javascript_driver = :browserstack_ie
  </code></pre>
  <p>UPDATE:
  I found some useful information <a href="https://github.com/SeleniumHQ/selenium/issues/4292" rel="nofollow noreferrer">here</a></p>
  <p>It sounds like the issue may be that Selenium is clicking in the wrong place, and that it can be fixed by changing the zoom settings in IE. Not clear to me how I would do this on a browser running in Browserstack though.</p>
  <p>I also discovered my Browserstack subscription doesn't support more than 100 minutes of automated testing time per month, which was a bit of a blow, so I can't immediately do anything further with this.</p>
  <p>I think I may end up running my own IE instance on a Windows machine on my local network and hook my tests up to that instead. I will update this card if/when I discover anything useful.</p>
  <p>Finally, I'd invite anyone who reads this to consider how many hours of their life they have wasted on supporting the many incarnations of IE. It is a blight upon the industry and Microsoft should be ashamed of it.</p>