python 测试用例怎么输入两个_python selenium多个测试用例
我有以下python代碼from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from unittestzero import Assert
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import ElementNotVisibleException
import unittest, time, re
class HomePageTest(unittest.TestCase):
expected_title=" some title here "
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(30)
self.base_url = "https://somewebsite.com"
self.verificationErrors = []
def test_home_page(self):
driver=self.driver
driver.get(self.base_url)
print "test some things here"
def test_whatever(self):
print "test some more things here"
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
unittest.main()
我的問題是,在函數test_主頁之后,firefox實例將關閉并再次打開,以便執行下一個test_任何函數。我該怎么做才能讓所有的測試用例都從同一個firefox實例執行。
總結
以上是生活随笔為你收集整理的python 测试用例怎么输入两个_python selenium多个测试用例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 找了代还信用卡钱刷不出来
- 下一篇: 十年期国债收益率