guo
guo

Reputation: 121

How to store input text as variable and use it to identify which element to be used on next test case

User input text when creating a folder and the folder name is stored as a variable for next test case.

The current test case uses a hardcoded folder name, I would want to use it dynamically.

Test case 1: how to store the value Folder Test W1

*** Test Cases ***
001_Save_Folder
     Click World Name
     Keyboard Input    insertText    Folder Test W1
     Click Save

Test case 2:

*** Test Cases ***
001_Delete_Folder
     Select Folder and Click Delete
     Click OK

The element (delete button) to delete the specific folder.

how to parse the variable to let the robot know which folder to select

${Delete-THIS-folder}               //td[text()='Folder Test W1']/following-sibling::td[.//span[@aria-label='delete']]

Upvotes: 0

Views: 777

Answers (1)

guo
guo

Reputation: 121

Got a solution by creating parameter:

*** Test Cases ***
001_Save_Folder
    Click World Name
    Keyboard Input    insertText    ${WorldName}
    Click Save

Then element:

${Delete-THIS-Map}               //td[text()='${WorldName}']/following-sibling::td[.//span[@aria-label='delete']]

Upvotes: 0

Related Questions