我有这样一个问题。我在这里处理的是一系列测试用例,其中mainreader.py文件中的一个脚本总是一行一行地分配一个用户名和密码。不幸的是,我不知道怎么做。每个TC调用mainreader时,应从新行中获取2个变量。 到目前为止,我在这个脚本中只有一个常规调用,但我不知道如何做
manireader.py:
import csv
with open ('aisg_users.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=';')
line_count = 0
for row in csv_reader:
if line_count == 0:
aisg_username = row[0]
aisg_password = row[1]
print(aisg_username)
print(aisg_password)
line_count += 1
else:
exit()
print("Not FOUND")
有人解决过这样的问题吗
在下图中,我为每个凭证指定了唯一的标题名,因此在我的自定义函数中,我将传递唯一的标题名,该标题名将标识行号,而行号+1是我的用户凭证位置
相关问题 更多 >
编程相关推荐