public void doExecute() {
final Cookie[] cookies = StoreCookie.getCookies(getContext());
LOG.debug("Found " + cookies.length + " cookie(s)");
if (cookies.length == 0) {
throw new StepFailedException("No cookie available!", this);
}
for (int i = 0; i < cookies.length; i++) {
Cookie cookie = cookies[i];
if (cookie.getName().equals(getName())) {
// just check for existence of cookie if no text given
if (getText() == null) {
return;
}
if (verifyText(cookie.getValue())) {
return;
}
throw new StepFailedException("Wrong cookie \"" + getName() + "\" value found!",
getText(), cookie.getValue(), this);
}
}
throw new StepFailedException("Cookie \"" + getName() + "\" not set!", this);
}