zoukankan      html  css  js  c++  java
  • 常用api操作,错误截图

    import os,time
    from selenium import webdriver
    import datetime
    current_path=os.path.dirname(__file__)
    wbdr01_path=os.path.join(current_path,'../webdriver/chromedriver.exe')
    driver=webdriver.Chrome()
    driver.get('https://www.baidu.com')
    driver.maximize_window()
    driver.find_element_by_name('wd'). send_keys('软件测试')
    driver.find_element_by_id('su'). click()
    time.sleep(3)
    driver.refresh()
    time.sleep(3)
    driver.back()
    time.sleep(3)
    driver.forward()
    time.sleep(3)
    current_data=datetime.datetime.now()
    print(current_data)
    err_img_path=os.path.join(current_path,'../error_img/03.png')
    print(err_img_path)
    driver.get_screenshot_as_file(err_img_path)
    time.sleep(3)
    driver.close()
    driver.quit()
  • 相关阅读:
    wed
    郁闷的星期三
    Mon
    烟斗信息
    10.3
    德国装甲兵之歌
    危急!开发进入瓶颈阶段
    血糯米粥
    上海:烟斗
    如果你的博客被转载?
  • 原文地址:https://www.cnblogs.com/tingting-yang/p/13335877.html
Copyright © 2011-2022 走看看