简体   繁体   中英

Using selenium, not able to open Firefox with a saved profile

I have created a new Firefox profile, and want to call the profile in my selenium code to load Firefox using this profile (plugins, etc).

Given the code below.

System.setProperty("webdriver.gecko.driver","D:\\Software\\Firefox\\Driver\\geckodriver-v0.10.0-win64\\geckodriver.exe"); 

FirefoxProfile profile = new FirefoxProfile(new File("C:\\Users\\Dev 8\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\j3yl2vj7.MyTest02"));                  

WebDriver driver = new FirefoxDriver(profile); 

It opens Firefox with the default settings, instead of with my particular profile with the plugins etc.

Version information:

  • Selenium : selenium-java-3.0.0-beta2
  • Java : Java SE 1.7
  • Firefox : 45.0.2

根据博客文章,您需要使用Java 8运行Selenium 3.0。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM