I would like to save elements into a list, and then run a FOR loop to iterate through them.
I have tried the following:
*** Keywords ***
User Claims Tasks
@{tasks}= Get WebElements ${claim}
FOR ${task} IN @{tasks}
Click Element ${task}
${missing}= Run Keyword And Return Status Element Should Be Visible ${miss}
Run Keyword If '${missing}' == 'True' Click Element ${miss}
${continue}= Run Keyword And Return Status Element Should Be Visible ${cont}
Run Keyword If '${continue}' == 'True' Click Element ${cont}
END
However, this does not work. It runs once, and then I get the error:
20200911 13:40:19.734 : FAIL : IndexError: list index out of range
20200911 13:40:19.737 : INFO : ${relation uid} = ('FAIL', 'IndexError: list index out of range')
20200911 13:40:19.742 : INFO : Relation UID:('FAIL', 'IndexError: list index out of range')
20200911 13:40:19.744 : INFO : Client Information:,
Ending test:
Any ideas on how to get this work?
@{tasks}= Get WebElements ${claim}as it is shown in the log.html. - Bence KaulicsClick Element ${task.get_attribute("id")}it will not use the stale webelement but will click on the element based on the ID. It will work if the page refresh or whatever is happening is not changing the ID of the tasks. - Bence Kaulics