【发布时间】:2018-07-29 18:54:02
【问题描述】:
我正在尝试使用 Firefox 分析。但它在代码的下面一行抛出错误。请看附件截图
请问有人可以帮忙吗?
代码:-
WebDriver driver = new FirefoxDriver(prof);
错误:-->
构造函数 FirefoxDriver(FirefoxProfile) 未定义
我正在使用的以下版本:-
- 硒--> 3.12.0
- Firefox 设置 50.0
代码:
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
public class Gmail {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "D:\\Drivers\\geckodriver.exe");
ProfilesIni allProf = new ProfilesIni();// all profiles
FirefoxProfile prof = allProf.getProfile("Abhi_Selenium");
WebDriver driver = new FirefoxDriver(prof);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://gmail.com");
【问题讨论】:
标签: java selenium firefox selenium-webdriver geckodriver