class Test_ddt_case3(unittest.TestCase): def setUp(self): self.web_tools = SeleniumDriver(SeleniumDriver.Chrome) self.phone_edite = Phone_edite(self.web_tools) self.web_tools.open_url_is_true("https://www.imooc.com/", "慕课网") self.web_tools.handle_windows(SeleniumDriver.Max) @ddt.data(*data) def test_register_case(self, data): phone, passwrod, error_cod, assert_text = data rest = self.phone_edite.register_function(phone) self.assertEqual(len(rest), 37, "预期结果错误") def tearDown(self): self.web_tools.close()
def setUp(self): self.web_tools = SeleniumDriver(SeleniumDriver.Chrome) self.phone_edite = Phone_edite(self.web_tools) self.web_tools.open_url_is_true("https://www.imooc.com/", "慕课网") self.web_tools.handle_windows(SeleniumDriver.Max)
#-*- coding: UTF-8 -*- import time from webdriver.SeleniumDriver import SeleniumDriver url = "https://wetest.qq.com/" atc_url = "https://atc.qq.com/" task_name = "" if __name__ == '__main__': driver = SeleniumDriver(SeleniumDriver.Chrome) driver.handle_windows(SeleniumDriver.Max) driver.open_url_is_true(atc_url, "WeTest") driver.click_element("tapd_login") time.sleep(3) driver.switch_web_index(3) driver.send_value("username", "t_jintang_ex") driver.send_value("password", "123@abAB") driver.click_element("submit")
def setUp(self): self.web_tools = SeleniumDriver(SeleniumDriver.Chrome) self.mlgoin = MkLogin(self.web_tools) self.web_tools.open_url_is_true("https://www.imooc.com/","慕课网") self.web_tools.handle_windows(SeleniumDriver.Max)
# -*- coding: UTF-8 -*- from webdriver.SeleniumDriver import SeleniumDriver if __name__ == '__main__': webdrive = SeleniumDriver(SeleniumDriver.Chrome) webdrive.open_url_is_true("https://www.baidu.com/",'百度一下') webdrive.wait_element()