Get Element - daniel-qa/RobotFramework GitHub Wiki

Get Element

*** Settings ***
Library    SeleniumLibrary

*** Test Cases ***
Get Multiple Web Elements
    Open Browser    https://www.example.com    chrome

    ${elements} =    Get WebElements    //a[@class='your-class-name']    # Selector to locate elements

    FOR    ${element}    IN    @{elements}
        Log    ${element.text}    # Print the text of each element
    END

    Close Browser

  • 取得元素個數
  ${count} =	Get Element Count	name:div_name
  Should Be True	${count} > 2	
  • List 指定特定元素
Input Text  ${elements}[1]  ${PIN}