Selenium IE driver not clicking when running with SpecRun but works when run with SpecFlow

576 views Asked by At

Background: We have a testing framework for running feature files using Selenium and the Firefox web driver. All feature files test pass when running under Firefox. For the test runners, we are using SpecFlow on developers/QA local machines and SpecRun on the CI servers. The web site that is being tested is written in classic ASP.NET.

Requirement: We would like to get the feature files test passing under Internet Explorer 11.

Approach: Get feature files test to pass on local machine with both SpecFlow and SpecRun

Machine Prep:

  • Set the zoom level for Internet Explorer 11 to 100%
  • Enabled Protected Mode for all zones in Internet Explorer 11
  • Set EnableNativeEvents = false for the Internet Explorer web driver (2.44.0)

All feature files pass on local machine running with SpecFlow

Issue: The same feature files FAIL on local machine when running with SpecRun. The problem is that EnableNativeEvents = false seems to be ignored and clicks are not working. I also tested on the CI server and the feature files failed there as well.

Feature file step to click search button works in SpecFlow Feature file step to click search button works in SpecFlow

Same step to click search button NOT WORKING in SpecRun (NOTE: the search button has focus) Same step to click search button NOT WORKING in SpecRun

Selenium is the component that is interacting with the web site. SpecFlow and SpecRun are just test runners. What could be the problem here?

Thanks in advance for your time.

2

There are 2 answers

1
Phonesis On

You've mentioned that the Dev/QA local machine runs Specflow and the CI machine runs SpecRun. Does the Dev/QA local machine also use SpecRun as the unit test runner?

If not, try using the same test runner on the CI machine and see if that solves the problem. It's worth trying.

0
Umesh Chhabra On

I assume that you want to run all of your tests in unattended mode as you are launching them through CI. To make IE work better in this scenario, you can add another capability.

capability.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS,true);

This is against the automation standards but IE works very well when it gets the focus.