添加3.0 jar文件后无法运行selenium java程序

时间:2016-10-25 19:57:54

标签: java selenium

我更新了我的项目以使用Marionette / gecko,当我尝试运行它时,我收到此消息:

1477424937782   geckodriver INFO    Listening on 127.0.0.1:11146
Oct 25, 2016 3:48:58 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1477424938364   mozprofile::profile INFO    Using profile path C:\Users\Janet\AppData\Local\Temp\rust_mozprofile.iMfi1TUVjDFi
1477424938367   geckodriver::marionette INFO    Starting browser C:\Program Files\Mozilla Firefox\firefox.exe
1477424938372   geckodriver::marionette INFO    Connecting to Marionette on localhost:50333
1477424939344   Marionette  INFO    Listening on port 50333
Oct 25, 2016 3:49:01 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
JavaScript warning: https://normandy.cdn.mozilla.net/static/bundles/selfrepair-910943d53dbd84b4c75a.a958f9d28733.js, line 7: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Element users was not found

1 个答案:

答案 0 :(得分:0)

使用下面的代码。您需要设置系统属性,以便找到您的geckodriver

 System.setProperty("webdriver.gecko.driver", "C:\\Selenium\\geckodriver.exe");


        driver = new MarionetteDriver();