i have used the above methods in my setup method and will call this before my test is run.. but still if i login to my application and close it without logging out . next time i login i directly go to my dashboard page instead of going to the normal login page. how can i correct it?
Please define the word "i" in this phrase: "but still if i login to my application"
Does the word "i" refer to you personally as a human performing an action?
Or does the word "i" refer to the test you are running?
If the former, wouldn't the solution be to always make sure you log out?
Log out i can do in the normal circumstances if the tests completed normally. but in case the test stops in some intermediate page and fails and then closes the browser there is no way i can do a log out. i was looking for a way out there!
Joined: Jan 05, 2012
i am referring to running my scripts. not doing it manually
Wouldn't a try-catch-finally block help? Something like this:
The other option is to do a general query before starting the test and see what that query returns. If it returns the portal home page, then send a logout and clear the cookies, and only then start the test.