Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:48:22+00:00 2026-06-15T19:48:22+00:00

I have a test script as follows, what I need to know is how

  • 0

I have a test script as follows, what I need to know is how I can make it to run in different browser at same time but with different test data,

Exactly what I want is I want parallel instance of Test Case one in Firefox and other in Internet Explorer, but again I want to use different data for it

Eg:
-Firefox with ‘username1’ and ‘password1’

-Internet Explorer ‘username2’ and ‘password2’

it is like logging into GMAIL with different usernames and password parallel in different browser but not in sequence.

Test Case :

public class Gmail 
{
    private WebDriver driver;

    @BeforeClass
    public void setup()
    {
        driver = new FirefoxDriver();
        driver.get("http://www.gmail.com");
    }

    @Test
    public void search()
    {
        WebElement element = driver.findElement(By.name("username"));
        element.sendKeys("username");
        WebElement element2 = driver.findElement(By.name("pass"));
        element2.sendKeys("password");
        element2.submit();
    }

    @Test
    public void compose()
    {
        driver.findElement(By.name("compose")).click();
    }

    @AfterClass
    public void exit()
    {
        driver.quit();
    }
}

Please give your suggestion would help in my project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:48:23+00:00Added an answer on June 15, 2026 at 7:48 pm

    Steps to do this:

    1. Pass the required values as parameters in testNG.xml – in your case you need browserName, userName & password.

    2. Create 2 separate “test” tag in testNG.xml with different userName & password parameter

         <test name="Test on FF">
          <parameter name="browserName" value="Firefox" />
          <parameter name="userName" value="user1" />
          <parameter name="password" value="pass1" />
         <classes>
            <class>name="Gmail"</class>
           </classes>
         </test>
         <test name="Test on IE">
          <parameter name="browserName" value="IE" />
          <parameter name="userName" value="user2" />
          <parameter name="password" value="pass2" />
           <classes>
            <class>name="Gmail"</class>
           </classes>
         </test>
      
    3. Define “suite” tag as <suite thread-count="2" name="Suite" parallel="tests">

    4. Access and use those in your @Test method by @Parameters ({"browserName","userName","password"}) and instantiate corresponding driver
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a script to run a test script on a batch of
have a javascript function as follows: function test(item) { var DataToBeShownOnScreen = jQuery.data(document.body, DataTobeShown);
I'm trying to write a script for a Black Jack game but have run
I have a script test.R that takes arguments arg1 , arg2 and outputs a
I have the following simple python test script that uses Suds to call a
I have a test suite to perform smoke tests. I have all my script
I have a test suite to perform smoke tests. I have all my script
We have a ubuntu test server that this simple script works fine on where
I have a unix shell script which test ftp ports of multiple hosts listed
I have a jquery function in my script function test(){ $.ajax({ url: '/Customer/test' +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.