从windows batch shell启动selenium自动测试并获取report

来源:互联网 发布:淘宝订单体检清洗过期 编辑:程序博客网 时间:2024/06/04 01:04
echo "This batch shell launch auto-run selenium test"if not exist "D:\SeleniumReport\" mkdir D:\SeleniumReport\taskkill /F /FI "IMAGENAME eq firefox*"del /F /Q D:\SeleniumReport\*cd C:\Program Files\Mozilla Firefoxstart /b firefox -chrome "chrome://selenium-ide/content/sel/core/TestRunner.html?auto=true&test=file://D:/test-case/VCSuite.html&userExtensionsURL=&baseURL=http://10.224.37.124/"for /l %%i in (1,1,3) do (ping -n 11 127.0.0.1>nulif exist "D:\SeleniumReport\SeleReport.html" goto next):nexttaskkill /F /FI "IMAGENAME eq firefox*"if not exist "D:\SeleniumReport\SeleReport.html" exit 1rename D:\SeleniumReport\SeleReport.html index.htmlexit 0

需要在firefox中关闭resume_from_crash地址栏输入about:config,找到resume_from_crash,设为false。
这样就可以通过hudson实现selenium的自动测试。