How I can create a function of the login test case in selenium web driver- python and how I can call it in other test cases?
basically I want to call my login test case in other test cases.
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.Sign up to join this community
With pytest, create a fixture for login in conftest.py
In conftest.py file,
@fixture(scope = 'function') def login(*args): <login_code>
In test files,
def test_home_page_icon(login): login() <test, verification code>
If you are not using pytest,you can import the login function in test file and call the function in test file.