0

I`m trying to use xpath type of parameter in my webdriver script.

However, although this parameter actually selects the same HTML tag:

By START_BUTTON = By.xpath(".//*[@name='MyName']");

as this one

By START_BUTTON = By.name("MyName");

I`m not being able to use the by.xpath in my testing script while the by.name is working fine

Not sure why I`m facing this issue. When tested in Firebug/FirePath the path: .//*[@name='MyName'] - points exactly to the same A tag as By.name("MyName");

Thanks

4

2 回答 2

0

我的错,我注释了实际上导致此问题的代码部分。对不起,打扰你。

问候

于 2013-11-14T09:34:56.953 回答
0

发布它以供参考:

这些是有助于识别元素的定位器策略。

以下策略主要用于识别元素:

  • 按 ID
  • 按名字
  • 按类名
  • 按标签名称
  • 通过链接文本
  • 通过部分链接文本
  • 通过 CSS
  • 通过 XPath
于 2013-11-14T15:49:37.667 回答