Running Capybara tests against Internet Explorer via Browserstack

Viewed 261

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.

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.

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:

fill_in 'Email', with: 'mr.jones@example.com'

without error, although a screenshot then shows nothing to have been filled in. Executing

click_on 'Sign in'

yields:

'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.'

I briefly experimented with send_keys 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.

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.

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.

Here is my current Capybara configuration:

  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 => :remote,
      :url => "http://#{ENV['BROWSERSTACK_USER']}:#{ENV['BROWSERSTACK_KEY']}@hub-cloud.browserstack.com/wd/hub",
      :desired_capabilities => caps
    )
  end
  Capybara.javascript_driver = :browserstack_ie

UPDATE: I found some useful information here

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.

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.

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.

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.

0 Answers
Related