HTML-код кнопки:
<button class="ui-button ui-corner-all ui-widget" type="button">Cancel</button>
Я пробовал также с локатором имени класса и текстом ссылки, пожалуйста, помогите.
Вы можете попытаться найти элемент, используя следующий xpath:
driver.findElement(By.xpath("//button[contains(@class,'ui-button ui-corner-all')]"));
Кнопку можно найти с помощью одного из следующих решений:
cssSelector:
cssSelector
driver.findElement(By.cssSelector("button.ui-button.ui-corner-all.ui-widget[type='button']"));
xpath:
xpath
driver.findElement(By.xpath("//button[@class='ui-button ui-corner-all ui-widget'][contains(text(),'Cancel')]"));