请看以下截图:
使用Selenium WebDriver如何处理Mozilla和Chrome浏览器中的地理位置弹出窗口?
![我的问题截图](https://istack.dev59.com/c9CrK.webp)
package tiyotesting;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.support.ui.Select;
public class Citydropdownlist {
public static void main(String[] args) throws InterruptedException {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
driver.get("http://ec2-35-154-164-82.ap-south-1.compute.amazonaws.com/tiyorelease3/");
WebElement ListBox = driver.findElement(By.id("supported_city_label"));
ListBox.sendKeys("Ahmedabad");
ListBox.sendKeys(Keys.ENTER);
}
}
我创建了一个Firefox自定义配置文件,但它仍然无法正常工作,弹出窗口再次出现,这是我的噩梦,请帮助我解决这个问题。