0

I am running a test using WebDriver (Chrome). The first step I need to accomplish is to install Chrome Auto Refresh Plus. However, when I click on the link, a pop-up window shows up with "Add" and "Cancel" options, and there is no xpath for it, so I cannot click on "Add".

WebDriver driver = new ChromeDriver();
driver.get("https://chrome.google.com/webstore/search-extensions/auto%20refresh?hl=en");
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div [@class='webstore-A-B-H webstore-test-button-label']")));
WebElement element= driver.findElement(By.xpath("//div [@class='webstore-A-B-H webstore-test-button-label']"));
element.click();
 \\ now a pop-up window shows up. is there any way to click on "Add"?
4

1 回答 1

0

There is no way to deal with it. However you may try to use Alert. It does not help all the time. Check this:

Click in OK button inside an Alert (Selenium IDE)

于 2013-03-18T03:28:42.137 回答