0

We are currently automating using IE browser using Selenium webdriver. in order to run our test cases we need to clear the cookie from Registry and run test case to start from page 1. Can you help me out to how we can do?

Dinesh
  • 11

1 Answers1

0

I hope question is not related to registry. There are two ways which doesn't need to work with registry key to clear cookies are:

  1. set capability ie.ensureCleanSession to true
iexplorer.additional.capabilities={'ie.ensureCleanSession':true}
  1. Through code delete all coockies
 driver.manage().deleteAllCookies(); 

Right place to put #2 is in driver listener onInitialize method.

public void onInitialize(QAFExtendedWebDriver driver){
 driver.manage().deleteAllCookies(); 
}
user861594
  • 5,733
  • 3
  • 29
  • 45