TestNG Articles

Page 8 of 8

How does the execution of a particular test method depend on other testnmethods in TestNG?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 11-Jun-2020 402 Views

The execution of a particular test method can be made dependent on another test method with the help of dependsOnMethods helper attribute.Example@Test(dependsOnMethods={"Payment"}) public void verifyLoan(){    System.out.println("Loan payment successful"); } @Test public void Payment(){    System.out.println("Payment successful "); } @Test public verifyTransaction(){    System.out.println ("Transaction verification"); }Here in the Java class file, verifyLoan() method will only be executed after the Payment() method is run successfully. But verifyTransaction() method runs independently without having a precondition test method to be executed.

Read More

What is the purpose of the testng.xml file?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 11-Jun-2020 2K+ Views

The testng.xml file has the numerous uses as listed below −Test cases are executed in groups.Test methods can be included or excluded in the execution.The execution of multiple test cases from multiple java class files can be triggered.Comprises names of the folder, class, method.Capable of triggering parallel execution.Test methods belonging to groups can be included or excluded in the execution.ExampleTestNG.xml file                                                         Here as per the xml file, ...

Read More
Showing 71–72 of 72 articles
« Prev 1 4 5 6 7 8 Next »
Advertisements