【发布时间】:2018-06-14 21:06:28
【问题描述】:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Webdriver {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.gecko.driver", "C:\\Selenium\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
//System.setProperty("webdriver.chrome.driver","C:\\Selenium\\chromedriver.exe");
//WebDriver driver = new ChromeDriver();
driver.get("https://maps.mapmyindia.com");
Thread.sleep(2000);
driver.findElement(By.id("auto")).sendKeys("TCS");
Thread.sleep(2000);
driver.findElement(By.id("auto_geo")).click();
当我在 eclipse luna 上运行此代码时出现错误:线程“主”org.openqa.selenium.SessionNotCreatedException 中的异常:无法找到一组匹配的功能
【问题讨论】:
-
你使用的是哪个firefox版本
标签: selenium firefox exception webdriver