Cross Browser Testing

Habtamu Petros

Last Update 3 jaar geleden

What is Cross Browser Testing?

Multi-browser testing or cross-browser testing is a type of testing in which the application under test is tested with multiple supported browsers.

Why do we need Cross Browser Testing?

  • Font size mismatch in different browsers.
  • JavaScript implementation can be different.
  • CSS, HTML validation difference can be there.
  • Some browsers still not supporting HTML5.
  • Page alignment and div size.
  • Image orientation.
  • Browser incompatibility with OS. Etc.

Step to perform Cross Browser Testing

Step 1: Launch Eclipse and create a new Java project by navigating to File > New > Java Project.

Step 2: Name your project and click Next.

Step 3: Add libraries by following the below-mentioned steps:

  1. Right-click on the project folder and select Properties.
  2. Choose Java Build Path.
  3. Go to Libraries, select the Class path, and click Add Library.

4. Select the option and upload the JARs for Selenium Java language bindings by navigating to the path where you have downloaded and saved it.

5. Once done, select Apply and Close.

Step 4: Cross-browser testing in Selenium can be carried out by parameterizing the browser variable. For parameterizing the browser variable we can use the @Parameter annotation of TestNG. Using the @Parameter annotation, we can pass different browser values to the test scripts from the testng.xml file.

Step 5: Create a TestNG XML file and set the parallel attribute as “tests.” To execute test cases with different browsers on the same machine simultaneously, a TestNG framework can be integrated with Selenium WebDriver.

Step 6: Run your test from testing.xml

Was this article helpful?

0 out of 0 liked this article