Name:
Get Matching Xpath Count
Source:
Selenium2Library <test library>
Arguments:
[ xpath ]
Returns number of elements matching `xpath`
If you wish to assert the number of matching elements, use `Xpath Should Match X Times`.

 

================

 

 

${str}   Get Matching Xpath Count     //table[@class="layout layoutblod"]/tbody/tr
log ${str}
${str1} Get Matching Xpath Count    xpath=//table[@class="layout layoutblod"]/tbody/tr[1]/td
log ${str1}

注意:参数是XPATH,所以直接写就行,不要写上XPATH=***,否则会报错:

Unable to locate an element with the xpath expression xpath=//table[@class="layout layoutblod"]/tbody/tr[1]/td because of the following error:\n[Exception... "The expression cannot be converted to return the specified type." code: "0" nsresult: "0x805b0034 (TypeError)"

相关文章:

  • 2021-04-04
  • 2021-07-07
  • 2021-06-11
  • 2021-06-23
  • 2021-11-02
  • 2021-11-28
  • 2021-05-16
  • 2022-12-23
猜你喜欢
  • 2021-04-04
  • 2022-01-11
  • 2021-07-08
  • 2022-12-23
  • 2021-12-01
  • 2021-12-01
  • 2022-12-23
相关资源
相似解决方案