测试:基础篇自动化测试selenium分享-打开浏览器

73 阅读1分钟

# 1.打开浏览器 from selenium import webdriver

chrome = webdriver.Chrome() # 2.打开bing网站 chrome.get("cn.bing.com/") # 3。输入关键词 chrome.find_element_by_id("sb_form_q").send_keys("51testing") # 4。点击搜索按钮 chrome.find_element_by_id("search_icon").click() # 5.输出搜索结果