【发布时间】:2018-02-01 16:00:26
【问题描述】:
我在 docker 中配置了 selenium 服务器。它工作正常 - 我可以连接到它,但是当我想与正在运行的本地闪亮应用程序交互时,Rselenium 看不到它。详情如下:
我一步一步做了:
-
我运行 selenium 服务器:
docker run -d -p 4445:4444 selenium/standalone-chrome 成功连接到 selenium 服务器:
remDr <- remoteDriver(remoteServerAddr = "localhost"
, port = 4445L
, browserName = "chrome"
, platform = "MAC")
> remDr$open()
[1] "Connecting to remote server"
- 从终端运行闪亮的应用程序(在单独的 r 会话中):
> shiny::runApp(file.path(find.package("RSelenium"), "apps", "shinytestapp"), port = 6012)
Listening on http://127.0.0.1:6012
- 然后尝试做一些测试:
remDr$navigate("localhost:6012")
appTitle <- remDr$getTitle()[[1]]
expect_equal(appTitle, "Shiny Test App")
得到错误:
Error: 'appTitle' not equal to "Shiny Test App".
1/1 mismatches
x[1]: "localhost"
y[1]: "Shiny Test App"
- 毕竟我做了截图:
remDr$screenshot(display = TRUE)
它看起来像这样:
你知道为什么 RSelenium 看不到在本地运行的闪亮应用吗?
【问题讨论】:
-
@jdharrison 我使用你的命令安装了 docker,它看起来像这样:
PORTS: 0.0.0.0:6012->6012/tcp, 0.0.0.0:4445->4444/tcp但 RSelenium 仍然看不到闪亮的应用程序。还有其他想法吗?
标签: r macos selenium shiny rselenium