自動化的作用
1.減少人為的重復(fù)操作
2.提高工作效率
3.人為無法做到的事情
自動化的測試環(huán)境
Python+selenium+瀏覽器
2.7版本的Python進(jìn)入Python安裝路徑,導(dǎo)航欄輸入cmd,輸入pip install selenium

3.62版本的Python進(jìn)入Python安裝路徑,導(dǎo)航欄輸入cmd,輸入pip3 install selenium

import time:時間變量
time.sleep(4):引用,休眠
引用???????????????????的
from selenium import webdriver
通過?????????????????????????啟動
driver = webdriver.Chrome()
向?yàn)g覽器輸入URL
driver.get("網(wǎng)址"):如:"http://www.baidu.com"
inputinfo.send_keys(""):向文本框輸入內(nèi)容①
driver.find_element_by_id("").send_keys(""):向文本框輸入內(nèi)容②
driver.find_element_by_id("").click():點(diǎn)擊事件
driver.find_element_by_id("").clear():清空
driver.find_element_by_id(""):根據(jù)ID定位
driver.find_element_by_name(""):根據(jù)name定位
driver.find_element_by_class_name(""):根據(jù)元素類名定位
driver.find_element_by_link_text(""):根據(jù)超鏈接定位
driver.find_element_by_xpath(""):萬能