selenium webdriver用于识别google play商店弹出窗口
我试图使用firebug在google play store中识别元素firebug成功地识别了元素,但当我执行selenium代码时,它抛出无效的选择器异常selenium webdriver用于识别google play商店弹出窗口,selenium,selenium-webdriver,selenium-rc,Selenium,Selenium Webdriver,Selenium Rc,我试图使用firebug在google play store中识别元素firebug成功地识别了元素,但当我执行selenium代码时,它抛出无效的选择器异常 1. Login to playstore with the gmail account. 2. In the search box, type whatsapp and click on install button 3. It opens popup, I wanted to click on dropdown values and
1. Login to playstore with the gmail account.
2. In the search box, type whatsapp and click on install button
3. It opens popup, I wanted to click on dropdown values and then click on install or just click on cancel button
For the cancel button, I wrote the following code:
driver.findElement(By.xpath(".//*[@id='purchase-cancel-button']")).click();
which is not working.
尝试使用下面的CSS选择器
By.cssSelector("button[id='purchase-cancel-button']");
Or
By.cssSelector("div.modal-dialog button[id='purchase-cancel-button']");
尝试使用下面的CSS选择器
By.cssSelector("button[id='purchase-cancel-button']");
Or
By.cssSelector("div.modal-dialog button[id='purchase-cancel-button']");
此项当前不可见,因此您必须延迟几秒钟,f.e `
`此项当前不可见,因此您必须延迟几秒钟 `
`whatsApp现在也是谷歌应用程序吗?如果有可用的id,为什么还要麻烦使用XPath呢?除非您专门查找另一个元素的子元素,否则我将使用“/”而不是“/”。您是否使用了
getWindowHandles()
来处理弹出窗口?例如,请参阅whatsApp现在也是Google应用程序吗?当id可用时,为什么还要麻烦使用XPath呢?除非您专门查找另一个元素的子元素,否则我将使用“/”而不是“/”。您是否使用了getWindowHandles()
来处理弹出窗口?例如,请参阅whatsApp现在也是Google应用程序吗?当id可用时,为什么还要麻烦使用XPath呢?除非您专门查找另一个元素的子元素,否则我将使用“/”而不是“/”。您是否使用了getWindowHandles()
来处理弹出窗口?例如,见