2017-02-04 81 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