Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear session cookies with Selenium IDE?

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?

like image 584
Anders Lindahl Avatar asked Feb 03 '10 10:02

Anders Lindahl


3 Answers

Found it myself, when I stopped thinking in terms of clear and tried delete:

  • deleteAllVisibleCookies
like image 111
Anders Lindahl Avatar answered Nov 08 '22 12:11

Anders Lindahl


I've found it most useful to simply begin all tests with a call to my logout page, and on that page purposely expire any sessions the user may have.

like image 14
Matthew Lock Avatar answered Nov 08 '22 11:11

Matthew Lock


deleteAllVisibleCookies

and put the site url in target

like image 2
Mai Hanafy Avatar answered Nov 08 '22 11:11

Mai Hanafy