首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RemoteWebdriver XPath的问题

RemoteWebdriver XPath的问题
EN

Stack Overflow用户
提问于 2012-01-19 17:04:39
回答 1查看 331关注 0票数 3

在不使用RemoteWebDriver的情况下运行测试时,只使用IWebdriver driver = new FireFoxDriver();

我可以很好地运行我的测试,查找元素,使用XPath表达式工作得很好,但是当我将我的设置切换到使用RemoteWebDriver时,我在测试过程中遇到了某个部分的错误。

我收到以下错误消息:

代码语言:javascript
复制
Attempting to find outbound radio input to click
2012-01-18 15:50:11,522 [Simple Test Driver] INFO  SeleniumGridExample.Utils.EventLogger -     The driver is a SeleniumGridExample.Utils.ScreenshotRemoteWebDriver
2012-01-18 15:50:11,522 [Simple Test Driver] INFO  SeleniumGridExample.Utils.EventLogger - Screenshot saved with exception: Session [1326893314795] not available - []
2012-01-18 15:50:11,522 [Simple Test Driver] INFO  SeleniumGridExample.Utils.EventLogger - The driver is a SeleniumGridExample.Utils.ScreenshotRemoteWebDriver
2012-01-18 15:50:11,522 [Simple Test Driver] ERROR SeleniumGridExample.Utils.EventLogger - Screenshot could not be saved: Unexpected error.

<html>
<head>
    <title>Error 501 Method {"USING":"XPATH","VALUE":"//INPUT[CONTAINS(@ID, is not defined in RFC 2068 and is not supported by the Servlet API </title>
</head>
<body>
    <h2>HTTP ERROR: 501</h2><pre>Method {"USING":"XPATH","VALUE":"//INPUT[CONTAINS(@ID, is  not defined in RFC 2068 and is not supported by the Servlet API </pre>
    <p>RequestURI='0_lsDirection_ctrl0_lsLegs_ctrl0_inpSelect')]"}GET /wd/hub/session/1326893314795/screenshot</p>
    <p>
      <i><small>
         <a href="http://jetty.mortbay.org">Powered by Jetty://</a>
         </small>
      </i>
   </p>
</body>
</html>

在座的任何人都知道为什么我使用RemoteWebDriver而不是普通的IWebDriver driver = new FireFoxDriver();时会遇到这个问题

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-11 11:37:19

尝试使用//INPUT@id='‘。这一定行得通。但最好尝试使用css选择器。Selenium在IE浏览器上使用expath选择器需要一些时间。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8923412

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档