如何处理Selenium WebDriver中的地理位置弹出窗口?
答案 0 :(得分:0)
加载主页后,只需执行以下操作:
WebElement elem = FluentWait<WebDriver>(driver)
.withTimeout(60, TimeUnit.SECONDS)
.pollingEvery(1, TimeUnit.SECONDS)
.ignoring(StaleElementReferenceException.class,
NoSuchElementException.class)
.until(ExpectedConditions
.elementToBeClickable(By.xpath(".//*[@id='allow']")));
elem.click();
答案 1 :(得分:0)
启动Naukri.com然后使用以下代码:
//For "Sure"
new WebDriverWait(driver, 30).until(ExpectedConditions.presenceOfElementLocated(By.id("allow")));
driver.findElement(By.id("allow")).click();