1

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.

Brian Singh
  • 6,686
  • 4
  • 25
  • 22
  • How does the exception look like exactly? – Saifur Dec 12 '14 at 21:25
  • No exception is thrown at this point (the clicking of the Search button). The click just disappears into the abyss. It is only on the next step when Selenium tries to interact with the result grid that ArgumentNullException is thrown. – Brian Singh Dec 15 '14 at 14:38

2 Answers2

0

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.

Phonesis
  • 323
  • 3
  • 12
  • I tried running both SpecFlow and SpecRun on my local machine. Tests pass with SpecFlow but not SpecRun because of the clicking not working. I have not tried SpecFlow on the CI machine as yet. Figured I need to get it working with both to eliminate any possible machine specific issue. – Brian Singh Dec 23 '14 at 19:02
0

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.

user229044
  • 232,980
  • 40
  • 330
  • 338