Answers for "cross browser testing in testng"

0

cross browser testing in testng

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
Posted by: Guest on December-07-2020
-1

what is cross browser testing

browser code is changing constantly 
to test your products health on  the 
				latest browsers, OSs, 
a cross browser testing platform using
mobile emulators & simulators, and real devices is helpful
...unless you have a dedicated QA team of 20 - 30 people.
Posted by: Guest on November-20-2020

Browse Popular Code Answers by Language