filmov
tv
Basic To Advanced Selenium Java Full Course - Session 13 - TestNG - Ignore Tests,Parallel Execution

Показать описание
Test NG - Ignoring Tests:
TestNG allows to ignore test methods for:
Class To ignore all tests in the class
Particular package To ignore all tests in a particular package
@Ignore annotation is used to ignore test methods
It is equivalent to @Test(enabled=false)
Test NG - Parameters:
TestNG allows to define any number of parameters in test methods
Parameters can be passed with the @Parameters annotation
XML parameters are mapped to the Java parameters in the same order as they are found in annotation
Parameters can be declared either under a suite or test tag
If two parameters have same name, one defined in test will have precedence
Data Provider is a method on the class that returns an array of objects
Data Provider method is annotated with @DataProvider
Test NG - Parallel Execution:
TestNG allows us to run our tests in parallel in different threads
parallel = “methods” : Each test method will run in separate thread
parallel = “tests” : Each test will run in separate thread
parallel = “classes” : Each class will run in separate thread
Number of threads can be specified by the thread count attribute
TestNG allows to ignore test methods for:
Class To ignore all tests in the class
Particular package To ignore all tests in a particular package
@Ignore annotation is used to ignore test methods
It is equivalent to @Test(enabled=false)
Test NG - Parameters:
TestNG allows to define any number of parameters in test methods
Parameters can be passed with the @Parameters annotation
XML parameters are mapped to the Java parameters in the same order as they are found in annotation
Parameters can be declared either under a suite or test tag
If two parameters have same name, one defined in test will have precedence
Data Provider is a method on the class that returns an array of objects
Data Provider method is annotated with @DataProvider
Test NG - Parallel Execution:
TestNG allows us to run our tests in parallel in different threads
parallel = “methods” : Each test method will run in separate thread
parallel = “tests” : Each test will run in separate thread
parallel = “classes” : Each class will run in separate thread
Number of threads can be specified by the thread count attribute