import unittest
from selenium
import webdriver
import time
from ddt
import ddt
,data
@ddt
class Fortest(unittest
.TestCase
):
def setUp(self
):
self
.driver
= webdriver
.Chrome
()
self
.driver
.get
("http://www.baidu.com")
def tearDown(self
):
time
.sleep
(3)
self
.driver
.quit
()
@data
('selenium',"python")
def test_1(self
,txt
):
self
.driver
.find_element_by_id
("kw").send_keys
(txt
)
time
.sleep
(1)
self
.driver
.find_element_by_id
("su").click
()
if __name__
== "__main__":
unittest
.main
()
转载请注明原文地址:https://tech.qufami.com/read-8118.html