session maintenance in selenium

  • 1 Replies
  • 1069 Views
session maintenance in selenium
« on: May 03, 2016, 05:24:54 am »
how selenium webdriver maintains session.

for eg,wiyhout using  webdriver, i have opened a browser  and logged into gmail,then i closed browser without logging out. then again i opened  the same browser and when i give the url,gmail.com,i am already logged into it.

with webdriver, i am not logged into gmail when i opened the second browser.

could somebody explain what is happening with webdriver.



*

Ruhit

  • *
  • 22
Re: session maintenance in selenium
« Reply #1 on: May 04, 2016, 15:25:10 pm »
This is the default behavior of the WebDriver.

A browser without cookies/session info/extensions is created so as to not be encumbered with preconditions that may exist from previous browsing. (Selenium enforces this since tests should be independent runs).

If you want the WebDriver to behave otherwise you need to explicitly tell it so, by adding cookies for example.

 

Sitemap 1 2 3 4 5 6 7 8