1

Hello in the following picture you can see that i am trying to click in the button in the shadow-root. enter image description here

My code:
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath("//iframe[starts-with(@name, 'a-') and starts-with(@src, 'https://www.google.com/recaptcha')]")));
            WebElement CaptchaClk = driver.findElement(By.cssSelector("div.recaptcha-checkbox-checkmark"));
            js.executeScript("arguments[0].click();", CaptchaClk);
            driver.switchTo().defaultContent();
            wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath("iframe[title='recaptcha challenge expires in two minutes']")));
            WebElement ClkSolveCaptcha = driver.findElement(By.cssSelector("#rc-imageselect > div.rc-footer > div.rc-controls > div.primary-controls > div.rc-buttons > div.button-holder.help-button-holder"));
            int widthClkSolveCaptcha = ClkSolveCaptcha.getSize().getWidth();

I was first in another frame so i came out of it and now i am trying to click in the second one i tried every solution i found and it never worked i tried every type of paths to click on it didnt work i tried to click on the div didn't work neither.

is it another frame that i need to acces so i press it ?

Yan
  • 108
  • 1
  • 8

0 Answers0