Forum Discussion

VTeja's avatar
VTeja
Visitor
6 years ago

is it possible to execute test cases simultaneously at a time on different browsers?

Hi All,

 

I want to run the same test cases in different browsers at a time. The browsers should open at the same time and the test cases should be executed. I've written a piece of code to execute the login scenario in different browsers using for loop. But in this case the chrome browser is opened first, executed the test case and then IE browser  later. So my requirement is, both the browsers should be launched at the same time and execution should be performed. PFB for the code written.

 

function Run_Login()
{
var browser_name = ["chrome","iexplore"];
for (i=0;i<browser_name.length;i++)
{
var Driver;
Driver = DDT.ExcelDriver("C:\\Users\\Nandini Thota\\Desktop\\Sagicor_FM\\Sagicor_FM\\TestData\\Login.xlsx", "Sheet1");
while (! Driver.EOF() )
{
//Read Columns
EmailID = DDT.CurrentDriver.Value("EmailID");
Password = DDT.CurrentDriver.Value("Password");

//Function execution
Log.AppendFolder("Login to the website with a registered user");
Browsers.Item(browser_name[i]).Run("https://www.hollandandbarrett.com/");
Login(); //Its a reusable function
Aliases.browser.Close();
//Next Record
Driver.Next();// Goes to the next record
Log.PopLogFolder();
}
}
}

2 Replies

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I second baxatob... that is EXACTLY the intention for the Distributed Testing feature.

       

      As an explanation as to why it won't work without Distributed Testing (and why making a feature request to make it work is probably futile) has to do with how TestComplete interacts with the application.  TestComplete does direct mouse clicks and keyboard events against the application under test.  So, when the tests are running, the tool "hooks" into those events in the operating system and operates against the UI as a user.  You can't have a mouse clicking on two different controls in two different browsers at the same time as a regular user so, it follows, TestComplete can't do it either.  The only solution is to use multiple machines to execute the tests simultaneously... hence Distributed Testing.

       

      Alternatively... you could hook into the "CrossBrowserTesting" tool to execute your tests on multiple browser/OS combinations.