Skip to content

Instantly share code, notes, and snippets.

@up1
Last active January 11, 2022 19:04
Show Gist options
  • Save up1/9df212f6feb2f26d4de4 to your computer and use it in GitHub Desktop.
Save up1/9df212f6feb2f26d4de4 to your computer and use it in GitHub Desktop.
Robot Framework :: Working with CSV file
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]
*** 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]
demo1 mode
demo mode1
demo1 mode1
mode
demo
*** Settings ***
Library CSVLibrary.py
@axg0516
Copy link

axg0516 commented Sep 21, 2021

wonderful, simple yet effective, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment