Posts

Showing posts from June, 2016

Selenium-TestNG: Set Dependency Among Test Methods

Image
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



Refer Selenium-TestNG Integration Tutorial Series
Author: Vaneesh Behl Join Telegram channel of this blog at https://t.me/techlisticspace Feel free to ask queries or share your thoughts in comments or email me.