Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internet cookies never get deleted while using selenium webdriver

 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!


Thanks
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am referring to running my scripts. not doing it manually
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
very good idea. will try this! thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic