[Python] Using conftest python file, but unable to access driver and driver method in...

Discussão em 'Python' iniciado por Stack, Fevereiro 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have created conftest.py file but I am not able to access driver and driver methods to different class of another file. please let me know what I am missing here, as I am new to python

    conftest.py


    import pytest
    from selenium import webdriver

    @pytest.fixture
    def setup(request):
    driver = webdriver.Chrome()
    driver.get("https://dev-web-azamtv.videoready.tv")
    request.cls.driver = driver
    yield driver
    driver.quit()


    test_login.py


    import pytest
    from testcases.conftest import setup


    @pytest.mark.usefixtures("setup")
    class VerifyLoginTest:

    def test_login(self):
    self.


    Here above not getting self.driver in Class VerifyLoginTest inside def test_login method i am supposed to have self.driver after writing self. but not getting any suggestion for driver also not it's method.

    Continue reading...

Compartilhe esta Página