I am trying to click on the checkbox that is displayed for "I am not a robot" verification. I am getting the error "Given xpath expression "//span[contains[@class, '.recaptcha-checkbox-checkmark']" is invalid: SyntaxError: The expression is not a legal expression."
The details are given below
<span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox" role="checkbox" aria-checked="false" id="recaptcha-anchor" tabindex="0" dir="ltr" aria-labelledby="recaptcha-anchor-label">
<div class="recaptcha-checkbox-border" role="presentation"></div>
<div class="recaptcha-checkbox-borderAnimation" role="presentation"</div>
<div class="recaptcha-checkbox-spinner" role="presentation"></div>
<div class="recaptcha-checkbox-spinnerAnimation" role="presentation"></div>
<div class="recaptcha-checkbox-checkmark" role="presentation"></div>
</span>
What I tried:
public void I_mark_checkbox_for_human_verification() throws Throwable
{
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[contains[@class, 'recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox']")));
element.click();
}
Please help me to resolve this. Any help is appreciated.
Aucun commentaire:
Enregistrer un commentaire