Running Selenium tests in Jenkins

本秂侑毒 提交于 2019-12-21 05:24:12

问题


I have recorded some simple selenium tests by Selenium IDE. Now I want to run those tests in Jenkins. Which plugin to Jenkins do I need to do that? And how to run the tests step by step? Help is appreciated.


回答1:


you can use recorded selenium IDE script and selenium-server.jar file to run it from Jenkins Here is steps:

  1. Go to SeleniumHQ page and download Selenium Server file Eg: selenium-server-standalone-2.33.0.jar
  2. Repair html test suite Use Selenium IDE to record then save as html test case and test suite then put them in a same folder eg: TestCase.html, TestSuite.html
  3. In jenkins
    • Plugin Seleniumhq
    • Configure Selenium runner file Manage Jenkins > Configure System > Selenium Remote Control: htmlSuite Runner = path to file u have download in step 1
    • Configure Job to run In Build field click " Add build step" then select "seleniumhq htmlSuite Run" browser: *firefox or *iexploer .... startURL: http://www.google.com or ... suiteFile: Input absolutely path to TestSuite.html file saved in step 2 resultFile: Input absolutely path to a file that results will be saved

Hope this help!




回答2:


I did the same but the following error occurred: Unable to find the HTML runner. This is normally because you have not downloaded or made available the 'selenium-leg-rc' jar on the CLASSPATH. Your test will not be run. Download the Selenium HTML Runner from http://www.seleniumhq.org/download/ and use that in place of the selenium-server-standalone.jar for the simplest way of running your HTML suite.



来源:https://stackoverflow.com/questions/14896905/running-selenium-tests-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!