Complete the code to add a cookie named "session" with value "abc123".
Cookie cookie = new Cookie("session", [1]); driver.manage().addCookie(cookie);
The cookie value should be "abc123" to match the requirement.
Complete the code to delete a cookie named "userToken".
driver.manage().deleteCookieNamed([1]);The method deleteCookieNamed requires the exact cookie name to delete it.
Fix the error in the code to get a cookie named "sessionId".
Cookie cookie = driver.manage().[1]("sessionId");
The correct Selenium method to get a cookie by name is getCookieNamed.
Fill both blanks to create and add a cookie with name "auth" and value "token123".
Cookie [1] = new Cookie([2], "token123"); driver.manage().addCookie(authCookie);
The variable name should be authCookie and the cookie name string should be "auth".
Fill all three blanks to create a cookie map with cookie names as keys and values as values, filtering only cookies with names longer than 4 characters.
Map<String, String> cookieMap = driver.manage().getCookies().stream()
.filter(c -> c.getName().length() [1] 4)
.collect(Collectors.toMap([2], [3]));The filter keeps cookies with name length greater than 4, and the map uses cookie name as key and value as value.