2016-10-01 4 views
0
다음과 같이

내 코드는 다음과 같습니다셀레늄은 액세스 할 수 없습니다 웹 페이지

public static void main(String[] args) { 
    WebDriver driver; 
    System.setProperty("webdriver.gecko.driver", "E:\\gecko\\geckodriver.exe"); 
    System.out.println("Gecko Driver Found"); 
    driver =new FirefoxDriver(); 
    System.out.println("WebDriver Established"); 
    driver.get("http://www.supremenewyork.com/shop/all/sweatshirts"); 
    System.out.println("Connection Established"); 
} 
} 

이 프로그램은 내가 바닥에 덤프합니다 드라이버를 설정하려고 할 때이 나에게 SessionNotCreatedException을 제공 실행합니다. 나는 지금 막 프로그램을 웹 페이지를 지금로드하게하고있다, 그래서 어떤 도움든지 중대 할.

콘솔 출력 : 다니엘 쳉에 의해 편집에

Sep 30, 2016 10:26:37 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 1475288797965 addons.xpi WARN Error loading bootstrap.js for {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: Module resource://gre/modules/commonjs/sdk/addon/bootstrap.js is not found at resource://gre/modules/commonjs/sdk/addon/bootstrap.js (resource://gre/modules/commonjs/toolkit/require.js:24) JS Stack trace: make/[email protected]:24:12 < @bootstrap.js:10:23 < @XPIProvider.jsm:4339:1 < [email protected]:4339:7 < [email protected]:4414:1 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 1475288797965 addons.xpi WARN Exception running bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: TypeError: this.bootstrapScopes[aAddon.id][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4442:8) JS Stack trace: [email protected]:4442:9 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 Sep 30, 2016 10:26:38 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Falling back to straight W3C remote end connection 1475288799084 addons.xpi WARN Error loading bootstrap.js for {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: Module resource://gre/modules/commonjs/sdk/addon/bootstrap.js is not found at resource://gre/modules/commonjs/sdk/addon/bootstrap.js (resource://gre/modules/commonjs/toolkit/require.js:24) JS Stack trace: make/[email protected]:24:12 < @bootstrap.js:10:23 < @XPIProvider.jsm:4339:1 < [email protected]:4339:7 < [email protected]:4414:1 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 1475288799085 addons.xpi WARN Exception running bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: TypeError: this.bootstrapScopes[aAddon.id][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4442:8) JS Stack trace: [email protected]:4442:9 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 Sep 30, 2016 10:26:40 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Falling back to original OSS JSON Wire Protocol. 1475288800182 addons.xpi WARN Error loading bootstrap.js for {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: Module resource://gre/modules/commonjs/sdk/addon/bootstrap.js is not found at resource://gre/modules/commonjs/sdk/addon/bootstrap.js (resource://gre/modules/commonjs/toolkit/require.js:24) JS Stack trace: make/[email protected]:24:12 < @bootstrap.js:10:23 < @XPIProvider.jsm:4339:1 < [email protected]:4339:7 < [email protected]:4414:1 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < c[email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 1475288800183 addons.xpi WARN Exception running bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}: TypeError: this.bootstrapScopes[aAddon.id][aMethod] is not a function (resource://gre/modules/addons/XPIProvider.jsm:4442:8) JS Stack trace: [email protected]:4442:9 < [email protected]:3334:1 < [email protected]:3443:23 < [email protected]:3604:34 < [email protected]:2092:25 < [email protected]:208:12 < [email protected]:667:5 < [email protected]:824:9 < [email protected]:2402:5 < [email protected]:55:7 Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=firefox, version=, platform=ANY}], required capabilities = Capabilities [{}] Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:29:23 -0700' System info: host: [REDACTED], ip: [REDACTED], os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101' Driver info: driver.version: FirefoxDriver at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:80) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:235) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:230) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:226) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:124) at copDatBogo.SupremeAccesser.main(SupremeAccesser.java:11)

답변

0

덕분에 나는 예외를 gopogle하고 문제를 진단 할 수 있었다.

Firefox를 다시 설치했지만 새 디렉토리에 설치했습니다. 내 부진 진단 기술에 대해 사과

package copDatBogo; 
import java.io.File; 
import org.openqa.selenium.By; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxBinary; 
import org.openqa.selenium.firefox.FirefoxDriver; 
import org.openqa.selenium.firefox.FirefoxProfile; 
public class SupremeAccesser { 



public static void main(String[] args) { 
     WebDriver driver; 
     System.setProperty("webdriver.gecko.driver", "E:\\gecko\\geckodriver.exe"); 
     File pathToBinary = new File("path to firefox.exe"); 
     FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary); 
     FirefoxProfile ffProfile = new FirefoxProfile(); 
     System.out.println("Gecko Driver Found"); 
     driver =new FirefoxDriver(ffBinary, ffProfile); 
     System.out.println("WebDriver Established"); 
     driver.get("URL"); 
     System.out.println("Connection Established"); 
    } 
} 

을하고 미래에 더 철저 오류 메시지를 빗합니다 다음과 같이 내 최종 기능 코드입니다.

관련 문제