- Where Developers Learn, Share, & Build Careers
I use Selenium WebDriver
, I need clear cookies before I execute the test I I use the code from the 'Selenium' site. This code is:
cookie cookie = new cookie ("key", "value"); Driver.manage () addCookie (cookie) Set up & lt; Cookie & gt; Allcookies = Driver. Management (). GetCookies (); (Cookie loaded cookies: all cookies) {System.out.println (string format ("% s ->% s", loaded cookiejetname), loaded cookie.get value ())); } Driver.manage (). DeleteAllCookies ();
But I get a notification: - The cookie can not be sorted in a way, the set can not be sorted in a way
java.util
is of the package.
is of org.openqa. Selenium
package.
You need to import those two sections to work your code:
import java.util.Set; Import org.openqa.selenium.Cookie;
In order to make pain less painful, every modern Java IDE has an auto-function for it:
- In eclipse, it "imports" Systematic "and sit under Ctrl + Shift + o .
- In IntelliJ, this is called "customizable import" and in netbins, it is called in any way and sits under Ctrl + + Kbd> Alt + o . Shift + I .
Comments
Post a Comment