简体   繁体   English

通过GitHub #Jenkins运行Selenium脚本

[英]Run selenium scripts through GitHub #Jenkins

I have been trying from last few days to integrate my selenium scripts which are located on GitHub repository with Jenkins but was unable to find anything useful/executable and nothing works for me so far. 最近几天,我一直在尝试将位于GitHub存储库上的Selenium脚本与Jenkins集成在一起,但找不到任何有用/可执行的内容,到目前为止,对我来说没有任何用处。 Does anyone has good steps to follow this scenario? 有没有人有良好的步骤来遵循这种情况? I have built my scripts on eclipse. 我已经在eclipse上建立了脚本。

I acheive the following : * Selenium IDE HTML suites are stored on Bitbucket (which is a GIT) on a specific repository of my webapp project, let say /WebContent/tests/htmlSuite.html * at the start and end of the build, I do run Selenium tests to ensure that building phase does not gives regressions. 我实现了以下目标:* Selenium IDE HTML套件存储在我的Webapp项目的特定存储库中的Bitbucket(这是一个GIT)上,比如说/WebContent/tests/htmlSuite.html *在构建的开始和结束时,我请执行Selenium测试以确保构建阶段不进行回归。

This is acheive with selenium-server that is launched with command lines. 这是通过使用命令行启动的selenium-server实现的。 The plugin did not worked for me. 该插件对我不起作用。

I do run a headless mode as I run my tests on EC2 Ubuntu so I had already installed VNCSERVER and configured it on display :6 我在EC2 Ubuntu上运行测试时确实运行了无头模式,因此我已经安装了VNCSERVER并在显示屏上对其进行了配置:6

I run the following script : 我运行以下脚本:

vncserver :6
export DISPLAY=:6

java -jar /var/lib/selenium/selenium-server.jar -trustAllSSLCertificates -acceptSslCerts -ensureCleanSession -htmlSuite "*chrome" "$URLStart" "$suiteTestFile" "$resultTestFile" -port 7856

vncserver -kill :6

where : 在哪里:

$URLStart = uri of tests
$suiteTestFile = location of your HTML suite
$resultTestFile = location of the result file

You can use HTML Publisher to then publish the report 您可以使用HTML Publisher来发布报告

Selenium tests did not work neither for me on firefox browser, this is why I use chrome. Selenium测试在firefox浏览器上也不起作用,这就是为什么我使用chrome。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM