日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

python 测试用例怎么输入两个_python selenium多个测试用例

發布時間:2024/10/12 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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多个测试用例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。