侧边栏壁纸
  • 累计撰写 23 篇文章
  • 累计收到 1 条评论

1+x考试自动化测试答案

root
2021-12-18 / 0 评论 / 168 阅读 / 正在检测是否收录...

题在这里
http://cytao.top/PDF/18号1+x_2.pdf

from selenium import webdriver
from selenium.webdriver.support.select import Select

driver=webdriver.Chrome()
driver.maximize_window()
driver.get("http://192.168.0.109:8080/suthr/logon")
driver.find_element_by_xpath("//*[@id='username']").send_keys("hrteacher")
driver.find_element_by_name("password").send_keys("123456")
driver.find_element_by_id("loginBtn").click()
driver.find_element_by_partial_link_text("人资工作").click()
driver.find_element_by_link_text("员工基本信息管理").click()
driver.find_element_by_link_text("员工照片管理").click()
ss=driver.find_element_by_name("existsFlag")
Select(ss).select_by_visible_text("未上传")
driver.find_element_by_class_name("btn-primary").click()
driver.find_element_by_class_name("btn-xs").click()
driver.find_element_by_name("file").send_keys(r"C:\Users\Litao\Desktop\22.jpg")
driver.get_screenshot_as_file(r"C:/Users/Litao/Desktop/18_2+x.png")
driver.quit()
from selenium import webdriver
driver=webdriver.Chrome()
driver.maximize_window()
driver.get("http://192.168.0.109:8080/suthr/logon")
driver.find_element_by_css_selector("#username").send_keys("hrteacher")
driver.find_element_by_xpath("//*[@id='password']").send_keys("123456")
driver.find_element_by_id("loginBtn").click()
driver.find_element_by_link_text("门户首页").click()
new=driver.find_element_by_xpath("/html/body/div[3]/div[1]/div/div/div/div[2]/div[2]/div/a")
driver.execute_script("arguments[0].removeAttribute('target')",new)
new.click()
driver.find_element_by_id("topicPreBtn").click()
driver.switch_to_alert().accept()               #新知识关闭提示的弹窗
driver.switch_to_alert().accept()
driver.quit()
0

评论 (0)

取消