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?
Asked
Active
Viewed 112 times
0
-
What exactly do you mean by _...clear the cookie from Registry..._? – undetected Selenium Jun 05 '19 at 06:49
1 Answers
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:
- set capability
ie.ensureCleanSession
totrue
iexplorer.additional.capabilities={'ie.ensureCleanSession':true}
- 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