<div id="button" data-testid="widgetButton" class=" chat-closed mobile-size__large">
我具有Webdriver无法找到的带有特殊字符的元素。
我正在尝试点击一个项目,我已经尝试了所有方法。我的最后尝试:
wd.get(urlSubpage);
wd.findElement(By.cssSelector("[class='widgetLabel']"));
您可以使用Webdriver在id
的帮助下单击,直到元素将能够获得点击。
WebDriverWait wait = new WebDriverWait(driver, 50);
wait.until(ExpectedConditions.elementToBeClickable(By.id("button-body")));