- 1
- 0
- 约小于1千字
- 约 1页
- 2026-03-12 发布于山东
- 举报
PAGE2
PAGE21
软件测试任务驱动教程
PAGE2
文件seleniumTestDemo55.py的完整代码
fromseleniumimportwebdriver
frommon.byimportBy
#打开Chrome浏览器
driver=webdriver.Chrome()
driver.maximize_window()
driver.implicitly_wait(10)
driver.get(https://126.com/)
#使用By.XPATH获取元素
xpath=driver.find_element(By.XPATH,//div[@id=loginDiv]/iframe)
#切换获取的iframe标签
driver.switch_to.frame(xpath)
#输入账号
driver.find_element(By.NAME,email).send_keys(kasthsoft)
#输入密码
driver.find_element(By.NAME,password).send_keys(password)
driver.find_element(By.ID,dologin).click()
#退出iframe标签
driver.switch_to.default_content()
driver.q
您可能关注的文档
- 软件测试任务驱动教程电子活页4-1Selenium WebDriver的优点与缺点.docx
- 软件测试任务驱动教程电子活页4-2下载与安装Selenium最新版本.docx
- 软件测试任务驱动教程电子活页4-3下载与解压缩Chrome浏览器驱动程序.docx
- 软件测试任务驱动教程电子活页4-4Selenium IDE的使用.docx
- 软件测试任务驱动教程电子活页4-5文件seleniumTestDemo04.py的完整代码.docx
- 软件测试任务驱动教程电子活页4-6文件seleniumTestDemo08.py的完整代码.docx
- 软件测试任务驱动教程电子活页4-7文件seleniumTestDemo09.py的完整代码.docx
- 软件测试任务驱动教程电子活页4-8文件seleniumTestDemo10.py的完整代码.docx
- 软件测试任务驱动教程电子活页4-9文件seleniumTestDemo14.py的完整代码.docx
- 软件测试任务驱动教程电子活页4-10文件seleniumTestDemo16.py的完整代码.docx
原创力文档

文档评论(0)