Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium 单击“按类链接”属性作为XPath_Selenium_Selenium Rc - Fatal编程技术网

Selenium 单击“按类链接”属性作为XPath

Selenium 单击“按类链接”属性作为XPath,selenium,selenium-rc,Selenium,Selenium Rc,我正在使用Selenium RC API.NET 2.44。我知道我可以单击以下Locator的链接: XPath://a[包含(@class,'handpoint')]或//a[(@class,'handpoint')] CSS:CSS=a.handpoint 但为什么我有机会点击与 selenium.click("class=handpoint"); 这是XPath的缩写吗?我没有使用这个API,但我使用了类似的API 可以通过3种不同的方式获取指定元素: 使用XPath 使用CSS 使用

我正在使用Selenium RC API.NET 2.44。我知道我可以单击以下Locator的链接:

  • XPath:
    //a[包含(@class,'handpoint')]
    //a[(@class,'handpoint')]
  • CSS:
    CSS=a.handpoint
  • 但为什么我有机会点击与

    selenium.click("class=handpoint");
    

    这是XPath的缩写吗?

    我没有使用这个API,但我使用了类似的API

    可以通过3种不同的方式获取指定元素:

  • 使用XPath
  • 使用CSS
  • 使用一些HTML属性(例如:
    id
    name
    class
    )或标记名

    在JavaScript中有一些类似的方法(例如:
    getElementById
    getElementsByTagName


  • 那么,你是在第三种情况下。这是另一种情况,不是XPath的简短形式。

    好的,谢谢。但是,第三种情况下,八个定位器(标识符、Id、名称、链接、DOM、XPath、CSS、UI元素)中的哪一个是指的?它标识所有看起来像:
    的HTML元素。这与DOM有关,但例如Id也与DOM有关……好吧,嗯,但DOM定位器的语法不同,或者是缩写形式,或者是特定API的功能,如for.nets。使用xpaths时,链接非常好