59

Python3:定时执行自动化测试脚本

 5 years ago
source link: http://www.10tiao.com/html/326/201806/2651237288/2.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
51Testing软件测试网 测试知识全知道

  1、Windows任务计划定时执行脚本

  (1)创建 .bat 文件,执行脚本的命令(interface.bat)

  cd C:\Users\xx\Documents\GitHub\python3\main

  python run_test.py 

  (2)计算机右键--管理--任务计划程序--创建任务

  选中(1)中创建的.bat文件路径,点击确定,任务新建完成

  2、Jenkins持续集成,定时执行脚本

  (1)Jenkins环境安装

  Jenkins下载地址:https://jenkins.io/download/,下载.war包

  使用.bat脚本安装

  set JENKINS_HOME=D:\jenkins

  cd /d %JENKINS_HOME%

  java -jar %JENKINS_HOME%\jenkins.war --httpPort=8080

  安装完成之后,浏览器登录http://localhost:8080/

  (2)新建定时任务

  说明:日程表依次是分钟--小时--日--月--星期

  构建完成,报存。到达相应时间,定时执行


  推荐阅读

点击阅读☞Docker+Selenium搭建和踩坑记录

点击阅读☞Selenium实现自动化下单、退款、撤销回归测试

点击阅读☞Selenium实例讲解网站登录及元素定位方法总结

点击阅读☞Python3+Selenium环境配置

点击阅读☞Python+ Selenium自动化登录腾讯QQ邮箱实例

上文内容不用于商业目的,如涉及知识产权问题,请权利人联系小编,我们将立即处理。

点击“阅读原文”,查看更多内容!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK