Last active
January 11, 2022 19:04
-
-
Save up1/9df212f6feb2f26d4de4 to your computer and use it in GitHub Desktop.
Robot Framework :: Working with CSV file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CSVLibrary(object): | |
def read_csv_file(self, filename): | |
file = open(filename, 'r') | |
csvfile = csv.reader(file) | |
file.close | |
return [row for row in csvfile] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** Settings *** | |
Library CSVLibrary.py | |
*** Testcases *** | |
Read file from csv | |
${all users}= Read CSV File sample.csv | |
:FOR ${user} in @{all users} | |
\ Log @{user}[0] - @{user}[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
demo1 | mode | |
---|---|---|
demo | mode1 | |
demo1 | mode1 | |
mode | ||
demo | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** Settings *** | |
Library CSVLibrary.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wonderful, simple yet effective, thank you