Search code examples
robotframeworkrobotframework-ide

For loop data sanity check fails in Ride


I have on my page several radio button series. I need to click on the first radio button of every "radio button list". I decided to do it with a for loop as I might have to add action on each radio button in the future. But Ride doesn't like my loop: it always dispays "ERROR:Data Sanity Check Failed.Reset Changes?"

MyKeyword
   [Arguments]    ${number}
   :FOR    ${i}    IN RANGE    0     ${number}
   \    Run Keyword If  '${i}'=='0'  Click Element  numAlternative1
   \    ...    ELSE    Click Element  numAlternative${i}1

What did I do wrong on my loop?


Solution

  • I ended up finding out that the FOR loop syntax has changed with Robot Framework 3.1, so that's why Ride didn't accept the old syntax. So the new way of writing FOR loops is:

    MyKeyword
       [Arguments]    ${number}
       FOR    ${i}    IN RANGE    0     ${number}
           Run Keyword If  '${i}'=='0'  Click Element  numAlternative1
           ...    ELSE    Click Element  numAlternative${i}1
       END