Microsoft Edge Clean Session

The Microsoft Edge driver does not provide a clean session whenever it runs selenium tests. Is it possible to indicate the desired features to fix this?

+4
source share
3 answers

Just run into this question today, so the only way to get it to work at the end was pretty simple. You should check the box "Always clean when I close the browser" in the Edge settings (and select the things you want to clear).

With this parameter, you will have a clean session with each new driver initialization :) selenium edge clean session

+5
source

, Edge ( , cookie):

EdgeOptions options = new EdgeOptions();
options.AddAdditionalCapability("InPrivate", true);
this.edgeDriver = new EdgeDriver(ptions);
0

, Edge - . , , .

, , ~ 1-3 .

  • Edge , , Browser = Edge.

  • , , , cookie, .

I don’t know about your test environment, but I use the ConfirmOnThisPage () methods every time I go from one page to another. So, as soon as I find out that the page is loaded, I can easily process the cookies that will be tested here by calling the DeleteCookie (Cookie cookie) function, which contains the page update as part of the confirmation method of my page. I am using the following:

public IWebDriver DeleteCookie(Cookie cookie){
    driver.Manage().Cookies.DeleteCookieNamed(cookie);
    driver.Navigate().Refresh(); 
    return driver;
}
0
source

Source: https://habr.com/ru/post/1655342/


All Articles