March 2, 2014

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.



5 comments:

  1. Selenium is really an excellent tool and your information related to selenium recording is really interesting. Also I want to know the latest new techniques which are implemented in selenium. Can you please update it in your website?
    Selenium training Chennai

    ReplyDelete
  2. Latest technology have created a greater impact over testing web applications. This vital in identifying important issues that raises in web appplications. Thanks for sharing this information in here. Keep blogging article like this.

    Selenium training in chennai

    ReplyDelete