Click here to see the element i want to click on but i cannot
无法点击Gmail应用程序中的“删除”按钮 当我检查元素并使用..... // * [@ aria-label ='删除']来编写xpath时....元素正在突出显示。但在运行时,它显示为在页面上找不到元素
请帮忙。在此先感谢!!
答案 0 :(得分:0)
尝试使用以下定位器,点击删除按钮
By.cssSelector("div[aria-label='Delete']>div>div")
修改-1 强>
尝试使用Actions类
new Actions(driver).click(driver.findElement(By.cssSelector("div[aria-label='Delete']>div>div"))).perform();