Showing posts with label CrossBrowser. Show all posts
Showing posts with label CrossBrowser. Show all posts

March 2, 2014

Cross BrowserTesting using Selenium Webdriver and TestNG

March 02, 2014 5
Cross BrowserTesting using Selenium Webdriver and TestNG
This is an attempt to explain the feature of selenium webdriver and TestNG.

Generally we will run a single test case or script at a time. If you want to run  a single test on different browsers it is possible with selenium webdriver and TestNG. Test will be executed parallel in two browsers.

Lets see..how we can achieve this

Prerequisites:

Sample Script:
Create a sample webdriver script using TestNG and in that script define a parameter using @Parameter annotation.

Below is the sample script:

Create TestNG:
Create a testNG.xml file to run your script. Parameter value we can pass it from here.

Below is the sample TestNG.xml file




Run your TestNG.xml file and three browsers will open and script will run on 3 browsers parallel.