0

你好 StackOverflow 社区,

我正在尝试使用实际设备运行 Selenium 网格。当我使用安卓手机时,我的设置(有点)有效,但是当我使用 iPhone 时,它​​给了我以下错误消息

"Error forwarding the request For input string: "(null)"

所以我的问题归结为:

  1. 如何使用 Selenium Grid2 设置 iPhone WebDriver?

到目前为止我做了什么:

网格设置:

设置硒网格

java -jar selenium-server-standalone-2.28.0.jar -role hub

设置 iPhone 节点

转到设置> iWebDriver

端口:3001

网格:localhost ip 地址和端口:4444

 java -jar selenium-server-standalone-2.28.0.jar -role webdriver -host [phone Host] -port 3001 -hub http://localhost:4444/grid/register -browser browserName=iPhone,platform=MAC

然后我使用以下内容运行junit测试

 public void testIphoneDriver() throws Exception {
    DesiredCapabilities capability = DesiredCapabilities.iphone();
    WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub") , capability);
    driver.get("http://www.google.com");   }

然后我收到一个错误“转发输入字符串的请求时出错:”(null)“奇怪的是,如果我直接连接到设备(用 iPhone IP 地址替换 localhost:4444)它工作正常。

下面是堆栈跟踪

引起:org.openqa.selenium.remote.ErrorHandler$UnknownServerException:转发新会话时出错 转发请求时出错输入字符串:“(null)”构建信息:版本:'2.28.0',修订:'18309',时间:'2012-12-11 15:53:30' 系统信息:os.name:'Windows 7',os.arch:'x86',os.version:'6.1',java.version:'1.6.0_25 ' 驱动程序信息:driver.version:在 org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java 的 org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:111) 未知:84) 在 org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 在 javax.servlet.http.HttpServlet。服务(HttpServlet.java:820)在组织。seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565) at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479) at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle( SessionHandler.java:225) 在 org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031) 在 org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406) 在 org.seleniumhq .jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186) 在 org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965) 在 org.seleniumhq.jetty7.server.handler.ScopedHandler .handle(ScopedHandler.java:117) 在 org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) 在 org.seleniumhq.jetty7.server.Server。org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47) 的 org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47) 的句柄(Server.java:349)。 .jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894) 在 org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948) 在 org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser .java:857) 在 org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235) 在 org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66) 在 org.seleniumhq.jetty7。 server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254) 在 org.seleniumhq.jetty7。util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) at java.lang.Thread.run(Unknown Source)

4

1 回答 1

0

We have provided some documentation on how to configure the connectivity and the Grid for the iPhone driver on the relevant wiki page for the Selenium project http://code.google.com/p/selenium/wiki/IPhoneDriver

You might also test connectivity exists between your tests and the hub; and the hub and the iphone with webdriver running on it; using telnet or even a web browser to connect to the respective URLs e.g. to

http://localhost:4444/wd/hub

if you're using a web browser on your machine that'll run the tests.

I hope that's sufficient to enable you and people in a similar predicament to get their tests working. Thanks for a detailed description of what you've done.

于 2013-03-25T10:39:41.803 回答