${rows} = Get Element Count //table[@id="Session Details"]/tbody/tr[position()>1]
FOR ${row_num} IN RANGE ${rows}
${row} = Get WebElement //table[@id="Session Details"]/tbody/tr[position()>1][${row_num}]
@{cells} = Get WebElements //table[@id="Session Details"]/tbody/tr[position()>1][${row_num}]/td
${data} = Create List
FOR ${cell} IN @{cells}
Sleep 3s
Wait Until Element Is Visible ${cell}
${text} = Get Element Attribute ${cell} innerText
${data} = Evaluate [cell.text for cell in $cells]
Log ${cell} contains text: ${text}
END
Log Row ${row_num} data: ${data}
END
Robot Framework Version - 3.1.2
Robot Framework Selenium Library Version - 3.3.1
The error that I’m getting is: No Keyword with name FOR found.
I even tried with old way of using for loop i.e. : For but got the same error as above
Can anyone guide me where I’m making mistake in my code?
FOR is part of the Robot Framework syntax since Version 3.1, so not sure why it’s not working in 3.1.2. As that is a very old version of Robot Framework (current version is 6.0.2), your best option is probably to try a more recent version as the issue has probably already been fixed.
I did try to reproduce your problem but with modern RF and SeleniumLibrary. This is a modified copy of your test, which passes in RF 6.0.2 and SeleniumLibrary 6.0.0: