reading a csv file to log in
Hi there,
I have a csv file that looks like this
username1, password1
username2,password2
username3,password3
my script does this
import csv
fname="
f = open(fname)
counter = 0
for line in f.readlines():
email, password = line.strip(
counter +=1
print email, password, counter
# script then attempts to log in using the first username and password
# Do Stuff
# Logout and hen log in as second user and repeat
#Logout and then log in as third user and repeat
#logout
f.close()
What happens is when I run the script it does this
username1 password1 1
username2 password2 2
username3 password3 3
Then it goes to log in but it logs in as the third user and not the first... I know this is a simple mistake that I am making as I am a novice.
What I am expecting to happen is
1. Open file
2. Read first row of file
3. Login and perform tasks
4. logout
5. Read second row of file
6. Login and perform tasks
7. logout
8. Read third row of file
9. Login and perform tasks
10. logout
Thank you !
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jeff
- Solved:
- Last query:
- Last reply: