How to get All Text in robot framework ?

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

Consider the following source code,

    <
6条回答
  •  一整个雨季
    2021-02-06 15:31

    Get Text will return content of the first element that matches the locator. When using XPATH you can specify the index of the element you want to get, like this:

    ${name1}    Get Text    xpath=//div[@id='groupContainer']//li[@class='contactNameItemContainer'][0]//span
    ${name2}    Get Text    xpath=//div[@id='groupContainer']//li[@class='contactNameItemContainer'][1]//span
    @{names}    Create List    ${name1}    ${name2}
    

提交回复
热议问题