1

I'm working with RobotFramework and trying to get the number of elements matching 'xpath'.

${count}=    Get Matching Xpath Count    //*[@id="alertForm:alertDetailTabSet:0:neTable:tbody"]/tr

The 'xpath' must be correct. When I search by xpath on the website, it finds me 18 elements what's ok. When I start the test and then look at log output ${count} equals zero. It should be also eighteen.

Does anyone know what's wrong? Thanks in advance !!!

4

2 回答 2

0

你试过Get Count吗?

${count}    Get Count    ${YourXpath}
log ${count}
于 2016-07-28T13:04:29.507 回答
0

尝试使用关键字获取元素计数

${count} 获取元素计数 ${YourXpath}

记录 ${count}

于 2021-11-19T17:14:36.757 回答