Validates specific cookie name and value pairs on Selenium WebDriver instances. Use in UI test automation suites for verifying browser cookies.
// Source: https://github.com/selenide/selenide | License: MIT | Copyright [2011-2025] [Andrei Solntsev & Selenide committers]
// Provided via justclaw.it.com; keep this notice with the code.
package com.codeborne.selenide.conditions.webdriver;
import com.codeborne.selenide.CheckResult;
import com.codeborne.selenide.ObjectCondition;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.WebDriver;
import java.util.Objects;
public class CookieWithNameAndValue implements ObjectCondition<WebDriver> {
private final String name;
private final String value;
public CookieWithNameAndValue(String name, String value) {
this.name = name;
this.value = value;
}
@Override
public String description() {
return String.format("cookie with name \"%s\" and value \"%s\"", n
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key