This is my web address:
DM :
This is my locator for button accept all:
@FindBy( xpath = "//button[@data-testid = 'uc-accept-all-button']")
WebElement cookies;
This is HTML:
I use selenium 4 and Java. I try solution like this :
public void acceptAllCookies( ) {
cookies = driver.executeScript("return document.querySelector('#usercentrics-root').shadowRoot.querySelector("cookies")");
cookies.click();
}
But it does not work. I have error like this:
Any help please. I am a beginner so i see this for first time
I try to add more " marks like in solution I find here but then I get whole executeScript like text.