首页 文章

Selenium远程配置问题

提问于
浏览
0

我得到了这个 . 错误而不理解缺失的部分 .

在点头上安装了镀铬和镀铬液https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver

使用Chrome驱动程序测试消息:测试方法SeleniumGridSmokeTest.UnitTest1.TestMethod1引发异常:System.InvalidOperationException:无法创建新服务:ChromeDriverService构建信息:版本:'3.6.0',修订版:'6fbf3ec767',时间:'2017- 09-27T16:15:40.131Z'系统信息:主机:'seleniumnode',ip:'10 .0.0.9',os.name:'Linux',os.arch:'amd64',os.version:'4.4.0 -97-generic',java.version:'1.8.0_151'驱动程序信息:driver.version:unknown(InsecureCertificate)使用Firefox驱动程序进行测试[5:18]消息:测试方法SeleniumGridSmokeTest.UnitTest1.TestMethod1引发异常:System.InvalidOperationException :无法创建新服务:GeckoDriverService构建信息:版本:'3.6.0',修订版:'6fbf3ec767',时间:'2017-09-27T16:15:40.131Z'系统信息:主机:'seleniumnode',ip: '10 .0.0.9',os.name:'Linux',os.arch:'amd64',os.version:'4.4.0-97-generic',java.version:'1.8.0_151'驱动程序信息:驱动程序 . 版本:未知(InsecureCertificate)

这些是我创建selenium远程服务器的步骤 .

答:我在谷歌 Cloud 中创建了2个ubuntu盒子 . **

  • 一个用于服务器

  • 一个节点

B.将java安装到两台机器上(经过检查的java版本)http://tipsonubuntu.com/2016/07/31/install-oracle-java-8-9-ubuntu-16-04-linux-mint-18/

C.Downloaded Selenium-server-standalone-3.6.0.jar wget“http://selenium-release.storage.googleapis.com/3.6/selenium-server-standalone-3.6.0.jar”D.Run hub命令java -jar Selenium-server-standalone-3.6.0.jar -role hub

E.运行node命令

java -Dwebdriver.chrome.driver = chromedriver.exe -jar selenium-server-standalone-3.6.0.jar -role node -hub http://xxxxxx:4444/grid/register

D.Saw控制台的屏幕
enter image description here

Configuration Information

browserTimeout:0 debug:false help:false port:5555 role:node timeout:1800 enablePassThrough:true cleanUpCycle:5000 host:10.0.0.9 maxSession:5 capabilities:Capabilities [{seleniumProtocol = WebDriver,browserName = chrome,maxInstances = 5,platform = LINUX}]功能:功能[{seleniumProtocol = WebDriver,browserName = firefox,maxInstances = 5,platform = LINUX}]功能:功能[{seleniumProtocol = WebDriver,browserName = Internet Explorer,maxInstances = 1,platform = LINUX}] downPollingLimit :2 hub:http://51.141.24.51:4444/grid/register id:http://10.0.0.9:5555 hubHost:51.141.24.51 hubPort:4444 nodePolling:5000 nodeStatusCheckTimeout:5000 proxy:org.openqa.grid.selenium.proxy.DefaultRemoteProxy register:true registerCycle:5000 remoteHost:http://10.0.0.9:5555 unregisterIfStillDownAfter:60000

致电代码
enter image description here

这些是我的应用程序中的包
enter image description here

HUB LOG

2017-11-01 17:00:17.120:INFO:osjs.Server:main:已启动@ 985ms 17:00:17.121信息 - 节点应注册到http://10.0.0.8:4444/grid/register/17: 00:17.121 INFO - Selenium Grid hub已启动并运行17:08:48.736 INFO - 已注册节点http://10.0.0.9:5555 17:15:14.628 INFO - 已收到创建新会话的请求:Capabilities [{ browserName = chrome,platformName = ANY,version =,platform = ANY}] 17:15:14.628 INFO - 尝试在测试槽上创建新会话{seleniumProtocol = WebDriver,browserName = chrome,maxInstances = 5,platform = LINUX} 17 :17:47.972 INFO - 有创建新会话的请求:Capabilities [{acceptInsecureCerts = true,browserName = firefox}] 17:17:47.973 INFO - 尝试在测试槽上创建新会话{seleniumProtocol = WebDriver,browserName = firefox,maxInstances = 5,platform = LINUX} 17:18:15.651 INFO - 有创建新会话的请求:Capabilities [{acceptInsecureCerts = true,browserName = firefox}] 17:18:15.651 INFO - 尝试创建一个新的测试槽上的会话{sel eniumProtocol = WebDriver,browserName = firefox,maxInstances = 5,platform = LINUX}

NODE LOG

17:17:48.015 INFO - 功能{acceptInsecureCerts = true,browserName = firefox,}匹配类org.openqa.selenium.remote.server.ServicedSession $ Factory(提供者:org.openqa.selenium.firefox.GeckoDriverService)17:17 :48.015 INFO - Capabilities {acceptInsecureCerts = true,browserName = firefox,} match class org.openqa.selenium.remote.server.ServicedSession $ Factory(provider:org.openqa.selenium.chrome.ChromeDriverService)17:18:15.649 INFO - 将默认提供者绑定到:org.openqa.selenium.chrome.ChromeDriverService 17:18:15.650 INFO - 找到处理程序:org.openqa.selenium.remote.server.commandhandler.BeginSession@77bf54a0 17:18:15.650 INFO - / session:Executing POST on / session(handler:BeginSession)17:18:15.651 INFO - 功能是:功能{acceptInsecureCerts = true,browserName = firefox,} 17:18:15.651 INFO - Capabilities {acceptInsecureCerts = true,browserName = firefox,} match class org.openqa.selenium.remote.server.ServicedSession $ Factory(provider:org.openqa . selenium.firefox.GeckoDriverService)17:18:15.652 INFO - Capabilities {acceptInsecureCerts = true,browserName = firefox,} match class org.openqa.selenium.remote.server.ServicedSession $ Factory(provider:org.openqa.selenium.chrome . ChromeDriverService)19:50:39.179 INFO - Selenium构建信息:版本:'3.6.0',修订版:'6fbf3ec767'19:50:39.179 INFO - 启动Selenium Grid节点2017-11-01 19:50:39.577:INFO :: main:登录已初始化@ 627ms至org.seleniumhq.jetty9.util.log.StdErrLog 19:50:39.633 INFO - 未找到驱动程序类:com.opera.core.systems.OperaDriver 19:50:39.654 INFO - 驱动程序提供商跳过类org.openqa.selenium.ie.InternetExplorerDriver注册:注册功能Capabilities [{ensureCleanSession = true,browserName = internet exp lorer,version =,platform = WINDOWS}]与当前平台不匹配LINUX 19:50:39.654 INFO - 跳过驱动程序提供程序类org.openqa.selenium.edge.EdgeDriver注册:注册功能Capabilities [{browserName = MicrosoftEdge,version =,platform = WINDOWS}]与当前平台不匹配LINUX 19:50:39.655 INFO - 跳过驱动程序提供程序类org.openqa.selenium.safari.SafariDriver注册:注册功能Capabilities [{browserName = safari,version =,platform = MAC}]与当前平台不匹配LINUX 19:50:39.673 INFO - 使用直通模式处理程序2017-11-01 19:50:39.693:INFO:osjs.Server:main:jetty-9.4.5.v20170502 2017 -11-01 19:50:39.713:警告:osjs.SecurityHandler:main:ServletContext @ osjsServletContextHandler @ 595b007d {/,null,STARTING}已发现路径的http方法:/ 2017-11-01 19:50:39.722: INFO:osjsh.ContextHandler:main:启动osjsServletContextHandler @ 595b007d {/,null,AVAILABLE}

AFTER STARTING THE HUB

xxx @ seleniumhub:〜$ java -jar selenium-server-standalone-3.6.0.jar -role hub 18:19:41.659 INFO - Selenium build info:version:'3.6.0',revision:'6fbf3ec767'18: 19:41.660 INFO - 启动Selenium Grid hub 2017-11-01 18:19:42.217:INFO :: main:登录初始化@ 772ms到org.seleniumhq.jetty9.util.log.StdErrLog 18:19:42.230 INFO - 会听在4444 2017-11-01 18:19:42.277:INFO:osjs.Server:main:jetty-9.4.5.v20170502 2017-11-01 18:19:42.313:INFO:osjs.session:main:DefaultSessionIdManager workerName = node0 2017-11-01 18:19:42.313:INFO:osjs.session:main:没有SessionScavenger设置,使用默认值2017-11-01 18:19:42.315:INFO:osjs.session:main:每600,000ms清理一次2017- 11-01 18:19:42.323:INFO:osjsh.ContextHandler:main:启动osjsServletContextHandler @ 1ad282e0 {/,null,AVAILABLE} 2017-11-01 18:19:42.354:INFO:osjs.AbstractConnector:main:已启动ServerConnector @ 1efee8e7 {HTTP / 1.1,[http / 1.1]} {0.0.0.0:4444} 2017-11-01 18:19:42.355:INFO:osjs.Server:main:Started @ 910ms 18:19:42.356 INF O - 节点应注册到http://10.0.0.8:4444/grid/register/ 18:19:42.356 INFO - Selenium Grid集线器已启动并运行

1 回答

  • -1

    在您的代码中,您使用 Google Chrome 作为浏览器,由 chromedriver.exe 初始化 .

    因此,在启动 Selenium Grid Node 时,我们必须为 chromedriver.exe 添加如下参数:

    java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.6.0.jar -role node -hub http://localhost:4444/grid/register
    

相关问题