无法在运行时单击Gmail应用程序中的“删除”按钮

时间:2016-09-20 10:56:23

标签: java selenium xpath selenium-webdriver

Click here to see the element i want to click on but i cannot

无法点击Gmail应用程序中的“删除”按钮 当我检查元素并使用..... // * [@ aria-label ='删除']来编写xpath时....元素正在突出显示。但在运行时,它显示为在页面上找不到元素

请帮忙。在此先感谢!!

1 个答案:

答案 0 :(得分:0)

尝试使用以下定位器,点击删除按钮

By.cssSelector("div[aria-label='Delete']>div>div")

enter image description here

修改-1

尝试使用Actions

new Actions(driver).click(driver.findElement(By.cssSelector("div[aria-label='Delete']>div>div"))).perform();