как я могу создать отдельный модуль для браузера в такой ситуации:
class JoinPage(unittest.TestCase):
def test_01_new_account(self):
with open('/home/andrey/PycharmProjects/test/jp/accounts.csv', 'rb', ) as csvfile:
the_file = csv.reader(csvfile, delimiter=',')
for row in the_file:
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--incognito')
chrome_options.add_argument('--start-maximized')
browser = webdriver.Chrome('/home/andrey/Downloads/chromedriver',chrome_options=chrome_options) # for incognito mode
wait = WebDriverWait(browser, 20)
browser.implicitly_wait(30)
browser.get('http://localhost:5000')
user = row[0]
password = row[1]
browser.xpath('html/body/div[1]/div/div/div[2]/form/div[2]/div/button').click()
browser.xpath(".//*[@id='Email']").send_keys(user)
browser.xpath(".//*[@id='next']").click()
browser.xpath(".//*[@id='Passwd']").send_keys(password)
Мне нужно, что бы при каждой итерации открывалось новое окно приватного браузера