【问题标题】:xpath and csspath from HTML code for using in WebDriver用于在 WebDriver 中使用的 HTML 代码中的 xpath 和 csspath
【发布时间】:2012-09-24 11:16:16
【问题描述】:

我有以下 HTML sn-p:

<label for="widget_118_login_username">Username</label>

在 Selenium 2 (WebDriver) 中使用的 xpath 和 csspath (cssSelector) 是什么?

【问题讨论】:

    标签: java xpath css-selectors selenium-webdriver


    【解决方案1】:

    以下对我来说很好用:

    Xpath: //标签[@for='widget_118_login_username']

    cssSelector: 标签[for=widget_118_login_username]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-14
      相关资源
      最近更新 更多