mercredi 23 août 2017

Cookies in Selenium Webdriver

I'm trying to add cookies to a link before I open it with webdriver but keeps giving me a

org.openqa.selenium.UnableToSetCookieException: Unable to set cookie (WARNING: The server did not provide any stacktrace information)

My code is

System.setProperty("webdriver.edge.driver","C:\\Program Files\\Latest Webdriver\\MicrosoftWebDrive.exe" );
    EdgeDriver = new EdgeDriver();

    Thread.sleep(2000);

    Cookie cookie = new Cookie("Testing", "11111");
    EdgeDriver.manage().addCookie(cookie);

EdgeDriver.get("http://ift.tt/1pDdizz"); // The link is an example 

Any reason as to why it's doing this?

Aucun commentaire:

Enregistrer un commentaire