python selenium multiple test cases

后端 未结 6 2069
孤街浪徒
孤街浪徒 2020-12-18 07:25

I have the following code in python

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Sele         


        
6条回答
  •  时光说笑
    2020-12-18 07:49

    Initialize the firefox driver in __init__:

    class HomePageTest(unittest.TestCase):
        def __init__(self):
            self.driver = webdriver.Firefox()
            self.driver.implicitly_wait(30)
            self.base_url = "https://somewebsite.com"
            self.verificationErrors = []
    
        ...
    
        def tearDown(self):
            self.driver.quit()
    

提交回复
热议问题