我需要您的幫助來使用Firebug設置我的Firefox配置文件。我想要的是當我通過Selenium WebDriver啓動它時,Firebug插件將被加載Firefox實例。這裏是我的代碼示例:Selenium和Firefox配置文件設置
final File file = new File("C:\\Program Files (x86)\\Gecko\\bin\\geckodriver.exe");
System.setProperty("webdriver.gecko.driver", file.getAbsolutePath());
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("?");
所以...我怎麼可以設置setPreference
值,使螢火蟲與Firefox的加載一起當硒的webdriver啓動瀏覽器?
Kotoj ..非常感謝跟進我的問題。這裏是代碼:final File file = new File(「C:\\ Program Files(x86)\\ Gecko \\ bin \\ geckodriver.exe」); System.setProperty(「webdriver.gecko.driver」,file.getAbsolutePath()); final String firebugPath =「C:\\ Users \\ jnguyen \\ AppData \\ Roaming \\ Mozilla \\ Firefox \\ Profiles \\ erx927l4.default \\ extensions \\ [email protected]」; FirefoxProfile profile = new FirefoxProfile(); profile.addExtension(new File(firebugPath)); driver = new FirefoxDriver(profile); –