0

Currently, our automation suite runs on Chrome (has been designed for Chrome).

We used Cucumber with Java and Selenium.

We are trying to make the current automation suite multi-browser compatible. The current automation code supports Firefox 50% and IE the least.

How do we make this code work on IE, Firefox?

Please suggest the easy ways.

4
  • Did you considered running the test with that other browsers and fixing any bugs? Or this approach is too hard? Dec 5, 2017 at 20:18
  • Yes I did run with other browsers. It least supports IE and partially supports firefox. In IE, some fields cannot be detected and some elements are not identified.
    – user29546
    Dec 5, 2017 at 21:10
  • @PeterMasiar Instead of changing the whole code, I am trying to do fixes to the present code and support IE. And also, It works very slowly on IE. Thanks!!
    – user29546
    Dec 5, 2017 at 21:12
  • Have you looked at Selenium grid?
    – Marit
    Jan 25, 2018 at 8:08

3 Answers 3

0

Usual approach is to develop your tests using custom wrappers, use those wrappers instead of bare calls. If different actions/tweaks are required for different browsers, you fix the wrapper (in a single place) and your tests should run without changes.

Of course it might be too late for you now, if you use bare calls in your tests.

Every such refactoring should a be a good learning experience.

As the saying goes:

  • To avoid mistakes you need a lot of experience.
  • Experience is a result of learning from past mistakes.

:-)

0
0

Cross Browser testing has a become a vital part of any automation and a good QA company will always use this logic in their automation frameworks.

If you have implemented Chrome in your framework, then there are 02 ways using which you can execute your scripts on other browsers -

Option 1: Update your existing 'Webriver load method' with the code to load IE and Firefox driver. You may have to add some capabilities along with this as well. Adding Capabilities will resolve most of the challenges -

For Firefox use capabilities like -

capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capabilities.setCapability("os_version", "10");
capabilities.setCapability("browser", "Firefox");
capabilities.setCapability("browser_version", "78.0");
capabilities.setCapability("os", "Windows")
            

For IE, certain pre-requisites are mentioned below - a) Enable protected mode. b) Update Browser zoom settings to 100% c) Use only 32 bit driver even if you are using 64 bit machine.

Use below capabilities -

capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
capabilities.setCapability("ensureCleanSession", true);
capabilities.setCapability("ignoreZoomSetting", true);
capabilities.setCapability("ignoreProtectedModeSettings", true);
capabilities.setCapability("ignore-certificate-error", true);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

You can also try on Edge using capabilities like -

  capabilities.setCapability("os_version", "10");
  capabilities.setCapability("browser", "Edge");
  capabilities.setCapability("browser_version", "83.0");
  capabilities.setCapability("os", "Windows");

Option 2: Nowadays, most of professional QA companies whether in the field of Security testing services or Software testing services, BrowserStack is getting widely used. If your code is stringent to update, you can use this cloud technology where you can use execute your test scripts on cloud browsers by writing a separate file to invoke remote browsers.

Note : BrowserStack is a paid tool but offers trial version as well.

0

As an automation tool, Selenium already provides the required multiple browser support on the browser automation side. You now need to refactor your current automation framework to make sure different capabilities (as per the browsers) are configurable, and your current frmaework is generic enough using the required Base classes related with PageObjects and Step Definitions.

The other point is to make sure the application behaviour for browser specific features is automated. Strategy design pattern may be used, or for starters you can include simple if-else statement in the current feature automation methods.

Your basic objective as per automation testing services is to eventually make your automation code-base as generic/configurable (supports multiple browsers) and as easy to maintain as possible (through frequent refactoring).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.