Showing posts from June, 2016

Selenium-TestNG: Set Dependency Among Test Methods

TestNG provides a way to manage method dependencies with annotation parameters. For this testNg provides 'DependsOnMethods' parameter for @Test annotation. If you have declared dependency of one method on second, then first of all second method will be executed and then after first method.  Below is the code snippet:

In above code, method SignIn() is dependent on OpenBrowser() and method LogOut() is dependent on SingIn and OpenBrowser methods. 
Below is the execution sequence of above code snippet: 1. OpenBrowser 2. SignIn 3. LogOut.
Output: This will execute first (Open Browser) This will execute second (SignIn) This will execute third (Log Out)

Selenium-TestNG Integration  << Previous    ||Next >>Set Priority inTestNG