Cross Browser Testing

What is Cross Browser Testing and why we need this?

When we develop a new web interface or functionality, we need to test this page. Basic functionality, Design, Accessibility, and Responsiveness may differ from browser to browser. For this reason, we need to test every new development in every browser, and in this case, we need to do cross-browser tests.

In this article, I am going to use Chrome and Firefox. I showed you how we use chrome browser in our tests, now I will add just Firefox driver. If you want to add other browsers, you can download and add those the same way.

Use this URL to download Firefox driver or geckodriver: and select macos.tar.gz. Now carry this driver to Drivers file or under the project. I created this file before under my project.

Create Package under test > java path and create a new java class. This code opens the browser and searches text on Google.

We added firefox and chrome drivers. Now we need to run the command on the terminal but you must be in the same path with pom.xml file.

The main command is:

mvn -Dtest=PackageName.ClassName -Dbrowser="browserType" test

In our case, if we want to run with chrome we use this command:

if we want to run with firefox we use this command:

The next article will about parallel testing. Thanks for reading.

Quality Assurance Engineer-Automation