2017-02-04 100 views
0

我有硒電網3.0.1設置有一個輪轂和三個節點如下:硒網格路由錯誤的節點

  • 第一個節點:與Linux的Chrome和Firefox
  • 第二個節點:視窗10使用Chrome,火狐,邊緣和Internet Explorer
  • 第三結點:Linux中Appium與Android模擬器

運行出於某種原因,網格不智能選擇節點基於平臺和b rowser。

我特別有IE和Appium的問題。

我開始集線器:

nohup java -cp selenium-video-node-2.1.jar:selenium-server-standalone-3.0.1.jar org.openqa.grid.selenium.GridLauncherV3 \ 
-servlets com.aimmac23.hub.servlet.HubVideoDownloadServlet \ 
-role hub \ 
2>&1 > logs/hub.log & 

我開始例如我的Linux節點,具有:

nohup java -Dwebdriver.chrome.driver="/home/ubuntu/testcloud/webdrivers/chromedriver" \ 
     -Dwebdriver.chrome.bin="/usr/bin/opera" \ 
     -Dwebdriver.chrome.logfile="/home/ubuntu/testcloud/logs/chrome.log" \ 
     -Dwebdriver.gecko.driver="/home/ubuntu/testcloud/webdrivers/geckodriver" \ 
     -Dwebdriver.firefox.bin="/home/ubuntu/testcloud/browsers/firefox/firefox" \ 
     -Dwebdriver.firefox.logfile="/home/ubuntu/testcloud/logs/firefox.log" \ 
     -cp selenium-video-node-2.1.jar:selenium-server-standalone-3.0.1.jar org.openqa.grid.selenium.GridLauncherV3 \ 
     -servlets com.aimmac23.node.servlet.VideoRecordingControlServlet -proxy com.aimmac23.hub.proxy.VideoProxy \ 
     -role wd -hub "http://172.31.1.65:4444/grid/register/" \ 
    2>&1 > logs/selenium.log & 

我配置驅動程序,在用Python:

d=DesiredCapabilities.INTERNETEXPLORER.copy() 
d['loggingPrefs']={ 'browser': 'ALL' } 
d["platform"]="WINDOWS" 
driver = webdriver.Remote(
    command_executor="http://"+HUB+":4444/wd/hub", 
    desired_capabilities=d 
) 
driver.maximize_window() 
driver.implicitly_wait(30) 

當我使用此配置運行測試,每3次中有2次,其他節點以類似方式響應:

Traceback (most recent call last): 
    File "test_appium.py", line 15, in <module> 
    driver = webdriver.Remote('http://35.154.75.140:4444/wd/hub', desired_caps) 
    File "/home/ubuntu/.photon/local/lib/python2.7/site-packages/appium/webdriver/webdriver.py", line 36, in __init__ 
    super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive) 
    File "/home/ubuntu/.photon/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__ 
    self.start_session(desired_capabilities, browser_profile) 
    File "/home/ubuntu/.photon/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session 
    response = self.execute(Command.NEW_SESSION, capabilities) 
    File "/home/ubuntu/.photon/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute 
    self.error_handler.check_response(response) 
    File "/home/ubuntu/.photon/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response 
    raise exception_class(message, screen, stacktrace) 
selenium.common.exceptions.WebDriverException: Message: The best matching driver provider Firefox/Marionette driver can't create a new driver instance for Capabilities [{app=https://transfer.sh/T20EJ/iifl.apk, platformVersion=4.4.2, platformName=Android, deviceName=Android 19}] 
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700' 
System info: host: 'ip-172-31-12-96', ip: '172.31.12.96', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-53-generic', java.version: '1.8.0_111' 
Driver info: driver.version: unknown 
Stacktrace: 
    at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance (DefaultDriverFactory.java:62) 
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call (DefaultSession.java:222) 
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call (DefaultSession.java:209) 
    at java.util.concurrent.FutureTask.run (FutureTask.java:266) 
    at org.openqa.selenium.remote.server.DefaultSession$1.run (DefaultSession.java:176) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617) 

任何人都可以幫我解決這個問題嗎?

回答

0

發現問題。

我希望Selenium Grid可以自動檢測平臺和瀏覽器並相應地進行路由。

看起來像不是這種情況,您需要定義一個JSON節點配置來指定匹配的功能。一個很好的例子是here