Cross Browser Testing using Selenium Webdriver

Hello Welcome to Selenium tutorial, today we will discuss Cross Browser Testing using Selenium Webdriver.

What is Cross browser testing?

Cross browser, testing refers to testing the application in multiple browsers like IE, Chrome, Firefox so that we can test our application effectively.IE, Chrome, Firefox so that we can test our application effectively.

Cross browser, testing is very important concept in Automation because here the actual automation comes into the picture.

Example- Suppose if you have 20 test cases that you have to execute manually, so it is not a big deal right we can execute in 1 day or 2 days. However, if the same test cases you have to execute in five browsers it means 100 test cases then probably you will take one week or more than one week to do the same and it will be quite boring as well.

If you automate these 20 test cases and run them then it will not take more than one or two hour depends on your test case complexity.

Cross Browser Testing using Selenium Webdriver

To achieve this we will use TestNG parameter feature, we will pass parameter from TestNG.xml file, and based on our parameter Selenium will initiate our browsers.

In this scenario, we will run the same testcase with two different browser parallel.

Step 1- Write testcase

package SampleTestcases;

 

Step 2- Create testng.xml and specify

 

Step 3- Run this xml file refer the below screenshot.

Note- To create testng.xml- Right, click on your testcase then go to TestNG then convert to TestNG> It will generate testng.xml then make changes as per above xml file and finish. You will get testng.xml file inside the project

 

Cross Browser Testing using Selenium Webdriver

Verify the output.

 

 

Cross Browser Testing using Selenium Webdriver

 

Note- For Cross Browser Testing using Selenium Webdriver you have to execute through testng.xml only.

Thanks for visiting my blog. Keep in touch.

Have a nice day 🙂

For More updates Learn Automation page

For any query join Selenium group- Selenium Group

48 Comments

  1. Mohinni
  2. Vina
  3. srinivas