I have a code here that reads the lines from the csv file. Each line. However, I need to read only one line, perform an operation - perhaps call another file.py, write the result, and then take the second line and continue the same way.
Now it works so that the cycle does everything to me at once. Some idea? Thank you.
with open(csv_user_file) as csv_file:
csv_file = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_file:
if line_count == 0:
self.driver.implicitly_wait(30)
print(row[0], '|', row[1])
u = row[0]
p = row[1]
print("Login")
username = self.driver.find_element_by_id("username")
password = self.driver.find_element_by_id("password")
username.send_keys(u)
password.send_keys(p)
self.driver.implicitly_wait(30)
ButtonLogin = self.driver.find_element_by_id("kc-login").click()
self.driver.implicitly_wait(50)
else:
exit()
print("Not FOUND")