在Linux系统下,
以下是启动服务器时的输出:
有时候,运行完全相同的脚本一切都会成功进行。可能是不同的计算机节点实际执行脚本的差异,但当无法连接时,我无法确定问题所在。
RSelenium
/Selenium
表现不稳定。我手动启动服务器时看起来正常运行。有时可以从我的R会话连接到它,但有时会出现错误。我还无法确定原因:相同的脚本有时可以工作,有时不能。有什么想法吗?以下是启动服务器时的输出:
12:41:25.811 INFO - Launching a standalone server
12:41:26.102 INFO - Java: Sun Microsystems Inc. 11.0-b16
12:41:26.102 INFO - OS: Linux 2.6.32-431.17.1.el6.x86_64 amd64
12:41:26.157 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
12:41:26.492 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
12:41:26.589 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
12:41:26.589 INFO - Version Jetty/5.1.x
12:41:26.590 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
12:41:26.590 INFO - Started HttpContext[/selenium-server,/selenium-server]
12:41:26.590 INFO - Started HttpContext[/,/]
12:41:36.597 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@2993a66f
12:41:36.598 INFO - Started HttpContext[/wd,/wd]
12:41:36.601 INFO - Started SocketListener on 0.0.0.0:4444
12:41:36.601 INFO - Started org.openqa.jetty.jetty.Server@6f507fb2
我在我的R会话中收到的错误信息:
Couldnt connect to host on http://localhost:4444/wd/hub.
Please ensure a Selenium server is running.Error in queryRD(paste0(serverURL, "/session"), "POST", qdata = toJSON(serverOpts))
有时候,运行完全相同的脚本一切都会成功进行。可能是不同的计算机节点实际执行脚本的差异,但当无法连接时,我无法确定问题所在。
remDr$open()
之前,尝试加入Sys.sleep(10)
,因为服务器可能需要一些时间来启动。 - jdharrison