#@pytest.fixture()
def create_list():
test_strings = ["Walker", "Rio"]
return test_strings
def test_supplier(create_list):
global driver
chrome_linux_64 = './Drivers/chromedriver_linux64'
driver = webdriver.Chrome(chrome_linux_64)
driver.get("https://iprocure.com")
username = driver.find_element(By.ID, "login")
username.send_keys(login_credientials.LOGIN_USER)
password = driver.find_element(By.ID, "Passwd")
password.send_keys(login_credientials.LOGIN_PASSWORD)
driver.find_element(By.ID, "btnLogin").click()
driver.find_element(By.LINK_TEXT, create_list).click()
driver.close()
time.sleep(3)
driver.quit()
for title in create_list():
test_supplier(create_list = title)
Hi, I would like to execute "test_supplier" function multiple times for multiple strings.
If I execute above code then after executing the tests I get below error on terminal
E fixture 'create_list' not found
> available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
and if I uncomment "@pytest.fixture()" then not even able to start the tests and get below error on terminal. Could some one make me to understand where I am doing wrong so could be corrected. Thank you
Fixture "create_list" called directly. Fixtures are not meant to be called directly,
but are created automatically when test functions request them as parameters.