2017-11-24 16 views
0

허브를 통해 오페라 및 에지 웹 드라이브에 연결할 수 없습니다. 내 절차 : cmd를오페라 및 에지 브라우저가있는 원격 웹 드라이버

  • 시작 허브 : cmd를

    java -jar C:\path\to\selenium-server-standalone-3.7.1.jar -role hub 
    
  • 시작 노드 :

     java -Dwebdriver.opera.driver=C:\path\to\operadriver.exe - 
         Dwebdriver.edge.driver=C:\path\to\MicrosoftWebDriver.exe -jar 
         C:\path\to\selenium-server-standalone- 
         3.7.1.jar -role node -hub http://mylocalhost:4444/grid/register 
         -browser "browserName=opera,maxInstances=5,platform=Windows" - 
         browser "browserName=edge,maxInstances=5,platform=Windows" 
    

그리고 오페라에 대해이 테스트를 실행합니다

   WebDriver driver; 
       String nodeURL; 
       nodeURL = "http://mylocalhost:5555/wd/hub"; 
     DesiredCapabilities capabilities = new DesiredCapabilities(); 
     capabilities.setBrowserName("opera"); 
     capabilities.setPlatform(Platform.WINDOWS); 
     driver = new RemoteWebDriver(new URL(nodeURL), capabilities); 
     driver.get("https://www.google.ru/"); 
을에지에 대한

org.openqa.selenium.WebDriverException: unknown error: cannot find Opera binary 

그리고 예외 :

   WebDriver driver; 
       String nodeURL; 
       nodeURL = "http://mylocalhost:5555/wd/hub"; 
     DesiredCapabilities capabilities = new DesiredCapabilities(); 
     capabilities.setBrowserName("opera"); 
     capabilities.setPlatform(Platform.WINDOWS); 
     driver = new RemoteWebDriver(new URL(nodeURL), capabilities); 
     driver.get("https://www.google.ru/"); 

이 원인 오페라에 대한 예외 :

그리고 에지에 대한내가 아는

org.openqa.selenium.SessionNotCreatedException: Unable to create new service: ChromeDriverService 

그 크롬과이 코드가 잘 작동 파이어 폭스. 누구나 Opera Edge 용으로 이것을 적용하는 방법을 알고 있습니까?

열린 오페라를 들어

답변

0

, 당신은 이진 파일 설정해야 가장자리를 들어

DesiredCapabilities capabilities = new DesiredCapabilities.opera(); 
capabilities.setCapability("opera.binary", "/path/to/your/opera"); 
capabilities.setCapability("opera.log.level", "CONFIG"); 
WebDriver driver = new OperaDriver(capabilities); 

을 - 그것은 당신을 도울 수 있기를 바랍니다 :

System.setProperty("webdriver.edge.driver", "C:/Program Files (x86)/Microsoft Web Driver/MicrosoftWebDriver.exe"); Your Edge driver path 
    DesiredCapabilities capability = DesiredCapabilities.edge(); 
    capability.setBrowserName("MicrosoftEdge"); 
    capability.setPlatform(Platform.WIN10); 
    WebDriver driver = new EdgeDriver(capability); 
    driver.get("http://www.google.com");