Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I'm writing Selenium tests for an ASP application and would like to test the cases when a session isn't properly initialized. Right now I'm clearing the cookies manually, but that is becoming a bit cumbersome.

(ok, to be honest, I forget it every fifth-or-so time and have to re-run the tests...)

Is there a way in Selenium IDE to clear session cookies or fake a browser re-start?

1 Answer

0 votes
by (62.9k points)

I have had the same problem in a PHP Project/

deleteAllVisibleCookies() removed almost everything for me that is, if a cookie for a "Remember Me" function which was created while making the application was also removed!

Instead I used $this->deleteCookie('PHPSESSID'); which delete the session.

Check out this link: deleteAllVisibleCookies

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, you should enroll yourself in industry-based Selenium online courses!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...