How can I create a function of login test case in selenium - python & how I can call it in other test case?



  • 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.



  • class LoginTest(unittest.TestCase):
        def test_first(self):
            self.login("username1", "password1")
    
        def test_second(self):
            self.login("username2", "password2")
    
        def login(self, username, password):
            ...
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2