How to get All Text in robot framework ?

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

Consider the following source code,

    <
6条回答
  •  佛祖请我去吃肉
    2021-02-06 15:40

    Here is the logic to get all elements in Java. You can adopt it to your need.

    You have to use findElements() and not findElement() to get all elements.

    List items = driver.findElements(By.cssSelector("ul#GroupContactListWrapper div.contactNameItem"));
    
    foreach(item in items){
       System.out.println(item.getText();
    }
    

    If you want a particular element from the list you can use items.get(1)

提交回复
热议问题