UI 自动化第一步,百度定位

from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get("https://www.baidu.com/")
time.sleep(2)

driver.find_element_by_id("kw").send_keys("pythin自动化测试")
driver.find_element_by_id("su").click()
try:
    assert u"百度一下,你就知道" in driver.title
    print("Assertion test pass")
except:
    print("Assertion test fail")
driver.quit()
回帖
请输入回帖内容 ...