I have a scenario where I need to iterate through multiple data sets for a single scenario via Excel, similar to how we do it in Selenium with a keyword-driven framework. Is it possible to create a keyword-driven framework logic in Robot Framework so that we can handle or run the test cases from Excel? If anyone came up with this scenario, could you please help me understand how we can proceed?
If more information is needed, we can have an open conversation via Google Meet or Microsoft Teams at your convenience. Feel free to reach out to schedule a meeting.
there are several ways you can do that, using excel files, csv files or having the data in the robot files, the key is to use a test template, see the link above for more details.
I hope this review of mine is still useful
you can do the same thing as me
*** Test Cases ***
Example Test Using Templates and FOR Loops
[Tags] 010
[Setup] Get info of excell file data_example_HDGTGT_002.xlsx F2_EDIT_HD
[Template] Testcase_action
FOR ${i} IN RANGE ${data_row_num}
${i}
END
[Teardown] close browser
*** Keywords ***
Get info of excell file
[Arguments] ${file_name} ${sheet_name}
Get screen name ${sheet_name}
file should exist \C:\Share\${file_name}
open excel document \C:\Share\${file_name} doc_id=docid1
need get data all
get total row num
${content} read excel column col_num=1 sheet_name=${sheet_name}
${row_num} get length ${content}
${row_num} evaluate ${row_num}+1
###
${row_list} create list
FOR ${i} IN RANGE 2 ${row_num}
${list_child} read excel row ${i}
log ${list_child}
append to list ${row_list} ${list_child}
END
set test variable ${row_list}
Finally, you can manually process the data taken from Excel according to the template