Multiple Tests for one Chromedriver window?
Hello.
I am not sure if this has been mentioned before as I am not sure what to really search for.
I am new to intelliJ and I am doing automated testing,
using selenium and chromedriver I have registered an account on a practise site.
now i have made another test to log in to that account.
I was wondering how I would make multiple tests but using the original chromedriver i logged in with window to stay up and proceed from there?
e.g: separate test for adding an item to cart.
I have set up different Java classes for the driver...methods and then the tests.
currently, If i were to run the first test. it opens the window and then logs me in
then I go to run the second test, in the same project. it will open a new window again. then obviously fail as there is no url. let alone a button to press.
Please sign in to leave a comment.
Please check https://www.hindsightsoftware.com/blog/selenium-webdriver-java .
You can have a single test class with @Before/@After annotated methods that will initialize the webdriver once and then multiple test methods inside the class that will perform the login and do any other actions with the same driver instance instead of creating a new driver for every test.