I want to know how run multiple files without running the before class() again and again.
E.g.: Consider i am writing test case for GMail
login.java: Which contains complete testing of the login page
inbox.java: Which contains complete testing of the inbox
spam.java: Which contains complete testing of the spam folder page
label.java: Which contains complete testing of create/edit/deleting of labels
Now every file contains a before class which has
- calling the browser
- input username and password
- clicking the submit button and after class which logs out
Using TestNG when I run, every time it will login, test for the particular file and logs out
It needs to run like this: It should login, then test the inbox, spam and label then logs out.
Is it the right way to execute? Or is there a solution for this?