I want to login only once,execute all the test cases the logout of the application and finally should close the browser | Selenium Forum
D
Dipika Gupta Posted on 17/11/2019

Hi, 

 

I have been given a task at office where I must login once then execute all test cases and 

finally logout of the application and close the browser.

 

First I tried @BeforeSuite to call the reusable methods for logging into the application, but that did not work

It was launching the browser, but not entering the URL and progressing further. 

I tried using @BeforeTest as well, but it does not work.  Also, the test ng file has all the tests in groups . Also, the java file that is referred in include name have all the priorities. The test suite works well when Login is performed each time but I want to login once and then perform all the test cases and then logout. Can you give me a skeleton for this code? I am not supposed to share it with you.


A
Ashish Thakur Replied on 18/11/2019

Which type of framework are you building- Data drive Hybrid, POM, Cucumber?