How to get All Text in robot framework ?

后端 未结 6 930
走了就别回头了
走了就别回头了 2021-02-06 15:01

Consider the following source code,

    <
6条回答
  •  隐瞒了意图╮
    2021-02-06 15:27

    You could iterate over the elements as below:

    ${xpath}=    Set Variable    //div[@id='groupContainer']//li[@class='contactNameItemContainer']//span
    ${count}=    Get Matching Xpath Count    ${xpath}
    ${names}=    Create List
    :FOR    ${i}    IN RANGE    1    ${count} + 1
    \    ${name}=    Get Text    xpath=(${xpath})[${i}]
    \    Append To List    ${names}    ${name}
    

    This works but is rather slow when there are many matches.

提交回复
热议问题