cross browser parallel testing

I achieve it with xml file.

In TestNG is quite simple to do parallel testing. .
First I create TestNG xml runner.
Then I create suites or test tags in the xml runner. In these tag, I point to
package or class I want to run.
Then I add and option like parallel="test" into pom.xml, it means all tests
will start running in parallel.

Inside suite<> tag there are 3 attribute which is name,parallel and 
thread count.

name is mandatory, it has parallel beause we want to run different threads
in this suite, we have thread count which is number of threads to use.

There is also parameter annotation where I define name and value;
In TestNG we can pass browser type from xml runner. In our java code, we use 
@parameters annotations to read this browser type parameter.

@Test
@Parameters("browser")
public void parameterized(String browser){
if(browser.equals("chrome")){
sout("open chrome")
}else if...
}

How to check if your TestNG runs in parallel
	inside methods you can use ==> Thread.currentThread.getId()
	should have multiple different thread ids

0
0

                                    Cross Browser Testing: When we do crossbrowser testing we
execute multiple test scripts on different browsers one by
one. When one test executed/completed another browser
would be invoked on the current browser.

--Parallel Execution: In parallel testing multiple browsers are
invoked simultaneously and all the test scripts are executed
parallelly.

0
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source