简体   繁体   English

如何在jenkins中运行selenium 2.0脚本

[英]How to run selenium 2.0 script in jenkins

I have selenium webdriver script, and i want to run the script in jenkins. 我有selenium webdriver脚本,我想在jenkins中运行脚本。 how to configure in jenkins. 如何在jenkins中配置。 what steps i need to fallow? 我需要休息的步骤是什么? i am new to jenkins, can any one tell me the step by step procedure to fallow. 我是詹金斯的新手,任何人都可以告诉我一步一步的休闲程序。

If you're running Jenkins on a unix machine, create a new job: Click on New Job, Type a name and click on Build a free-style software project 如果您在unix机器上运行Jenkins,请创建一个新作业:单击New Job,键入一个名称,然后单击Build a free-style software project

Then add a 'build' step called 'Execute shell'. 然后添加一个名为“Execute shell”的“构建”步骤。 (For windows you can use Windows Batch command). (对于Windows,您可以使用Windows Batch命令)。

Using that you can run the selenium standalone server jar to execute the your selenium script. 使用它,您可以运行selenium独立服务器jar来执行您的selenium脚本。

For example: java -version && java -jar /Applications/SeleniumRC/selenium-server-standalone-2.12.0.jar -trustAllSSLCertificates -htmlSuite "*googlechrome" " https://user:password@www.example.com/ " "examplesuite.html" "result_file.html" 例如:java -version && java -jar /Applications/SeleniumRC/selenium-server-standalone-2.12.0.jar -trustAllSSLCertificates -htmlSuite“* googlechrome”“ https:// user:password@www.example.com/ ” “examplesuite.html”“result_file.html”

Other option would be to go to Configure Jenkins -> Configure Plugins and install Hudson Seleniumhq plugin and use the build step provided by them when configuring the jenkins job. 其他选项是转到配置Jenkins - >配置插件并安装Hudson Seleniumhq插件,并在配置jenkins作业时使用它们提供的构建步骤。

You might also want to create a Post-build Action to show reports. 您可能还想创建一个Post-build Action来显示报告。 If you install Selenium HTML report plugin from the aforementioned Manage Plugins page, you can then add 'Publish selenium report' Post-build step. 如果您从前面提到的“管理插件”页面安装Selenium HTML报告插件,则可以添加“发布selenium报告”构建后步骤。

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

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