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()
  • 相关阅读:
    Ubuntu下 实现Linux与Windows的互相复制与粘贴
    bzoj2426
    bzoj1835
    bzoj1197
    bzoj1049
    bzoj2893
    bzoj1820
    bzoj1819
    bzoj1455
    bzoj3689
  • 原文地址:https://www.cnblogs.com/tingting-yang/p/13335877.html
Copyright © 2011-2022 走看看