Seleniumhq Plugin

Plugin Information

Plugin ID seleniumhq
Latest Release 0.2
Latest Release Date May 28, 2009
Changes via Fisheye In Latest Release
Since Latest Release
Maintainer(s) n/a (id: usager)
Issue Tracking Open Issues

This plugin allows you to run and load HTML Selenese suite result generate by Selenium Server from Seleniumhq.
Hudson will generate the trend report of test result.

The Seleniumhq plug in can be downloaded here.

Configuring the Seleniumhq Plugin

Global config

  1. Configure Seleniumhq test runner (selenium-server.jar path) [via Manage Hudson -> Configure System]

Job config

  1. Install the selenium plugin [via Manage Hudson -> Manage Plugins]
  2. Configure your project's build script to generate Seleniumhq HTML reports (See below for examples with Ant Command, batch Command and Hudson build step)
  3. Enable the "Publish Selenium Report" publisher
  4. Specify the test file to load

Configuring build tools

Here are the configuration details for common build tools. Please feel free to update this with corrections or additions. 

Build Step in hudson

You can lauch the HTML Selenese suite with selenium-server with the buid step provide by this plugin.
This step make exactly the same as Batch command (See below) but the plugin offer ther possibily to enter an PATH or an URL for the suiteFile param.

  1. Add a build step (SeleniumHQ htmlSuite Run) in your job configure page
  2. Field the mandatory field

Batch command

  1. Add a build step (Execute Windows batch command) in your job configure page
  2. Add command to lauch HTML Selenese suite with selenium-server
    java -jar selenium-server.jar -htmlSuite "*firefox" http://www.google.com
    "c:\absolute\path\to\my\HTMLSuite.html" "%WORKSPACE%\results.htm"
    


Ant

We've also provided an Ant task to make it easier to launch the tests. Run it like this: Seleniumhq doc

<taskdef resource="selenium-ant.properties">
    <classpath>
        <pathelement location="selenium-server.jar"/>
    </classpath>
</taskdef>
<selenese
    suite="c:\absolute\path\to\my\HTMLSuite.html"
    browser="*firefox"
    results="c:\absolute\path\to\my\results.html"
    multiWindow="true"
    timeoutInSeconds="900"
    startURL="http://www.google.com" />

Result

Build summary

Build Report

Project summary

Project Report (Last build selenium report) P.S : If you need save all build report use "Archive the artifacts" in project config

Version History

Version 0.2 (2009-05-28)

  • Add support for build on slave (Thank to Alexis)
  • Add relative paths support for suite file (relative to the workspace) (Thank to Alexis)
  • New icone (Thank to Erwan)

Version 0.1 (2009-01-23)

  • Initial release. 

Labels:

plugin-builder plugin-builder Delete
plugin-report plugin-report Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Jan 23, 2009

    Erwan de FERRIERES says:

    Pascal,  you've done exactly what we were planning to develop ! So you...

    Pascal,

     you've done exactly what we were planning to develop ! So you can imagine that I'm impatient to test it !

    When will it be released ?

    1. Jan 23, 2009

      Pascal Martin says:

      Release 0.1 is now available downloaded here

      Release 0.1 is now available downloaded here

  2. Feb 03, 2009

    Erwan de FERRIERES says:

    Is it possible to use the environment variables to name the results files ? With...

    Is it possible to use the environment variables to name the results files ? With this possibility, there will be no need to use the "Archive the artifacts" option.

    What do you think of this idea ?

    1. Feb 04, 2009

      Pascal Martin says:

      Not is not possible to use environment variables in the name. But the file was...

      Not is not possible to use environment variables in the name.

      But the file was generate in the workspace.
      You can add other Build Task like windows batch command task to rename the file like:

      rem Rename the file result index.html to index-%BUILD_NUMBER%.html
      ren index.html index-%BUILD_NUMBER%.html

      You can also copy file result to you prefered location

  3. May 05, 2009

    Daniel Tkatch says:

    Hello!  First of all, I wish to thank you very much for a usefull p...



    Hello!

     First of all, I wish to thank you very much for a usefull plugin!

     I have a following question. The plugins provides a possibility to specify a URL to the suiteFile (e.g. in my case http://localhost/testslib/html/Login.html). As I understand a local copy of the suite file is created and executed. Unfortunately, I never succeeded to run a test providing an URL to the suiteFile because the test files (linked from the suite file) seem not to be downloaded. All I see the following error in the test's iframe of the TestRunner:


    HTTP ERROR: 404

    Not foundRequestURI=/selenium-server/tests/tests/login.html

    Powered by Jetty://

     Help would be greatly appreciated.

    Thank you in advance,

    Daniel Tkatch

    1. May 15, 2009

      Pascal Martin says:

      Does he work well if you use a path like (C:\Login.html) ? Make sure you enter ...

      Does he work well if you use a path like (C:\Login.html) ?

      Make sure you enter the correct startURL like (http://localhost)
      try add other param like (-avoidProxy)
      Adjuste your part in your test suite.

  4. Jun 03, 2009

    Luqman Samad says:

    First off, thank you. This is a very help piece of coding. I have a usage quest...

    First off, thank you. This is a very help piece of coding.

    I have a usage question. We are doing something like this but not so nicely integrated into Hudson. We run the selenium tests with ant and then parse the html file into Junit style reports.

    What I would like to do is to simply use what you have developed and run my TestSuite.html from the Hudson dashboard rather then the build script, it will make the process much more flexible and easy to use. What I don't understand is how to pass some extra parameters to the "SeleniumHQ htmlSuite Run" build step.

    How would I do that? Here is a listing of the parameters:
    haltonfailure="true"
    multiWindow="true"
    timeoutInSeconds="3000"
    firefoxProfileTemplate="/firefox-https-profile"

    http://release.seleniumhq.org/selenium-remote-control/0.9.2/doc/server/org/openqa/selenium/server/ant/SeleneseAntTask.html

    1. Jun 03, 2009

      Pascal Martin says:

      in the "other" box of "SeleniumHQ htmlSuite Run" build step add:  -timeout...

      in the "other" box of "SeleniumHQ htmlSuite Run" build step add:

       -timeout 3000 -firefoxProfileTemplate "/firefox-https-profile"

      This parameter are added in command line exexute by the build step, see job log for complete command execute by the build step
      Ex: java -jar selenium-server.jar -timeout 15600 -firefoxProfileTemplate "/firefox-https-profile" -htmlSuite «browser» «startURL» «suiteFile» «resultFile»

      multiWindow is default option when run with selenium-server-1.0-beta-2
      I think of selenium-server-1.0-beta-2 have no parameter for haltonfailure!

      1. Jun 03, 2009

        Luqman Samad says:

        Pretty sweet. I will try right away.

        Pretty sweet. I will try right away.

  5. Jun 18, 2009

    raghuraman.shanmugam says:

    Hi Pascal Martin,  First of all I appreciate the great work you did! ...

    Hi Pascal Martin,

     First of all I appreciate the great work you did!

     Currently, I have tried following stuffs:

        Hudson 1.310

        Selenium HQ plugin 0.2

        Browser : *firfox, *ietha,etc..,

     But Selenium IDE testscripts are NOT running at all

    Could you please help out?

    -------------------------------------------------------------------------------

     Previously I used

         Hudson 1.306

        Selenium HQ plugin 0.1

        Browser : *firfox, *ietha,etc..,

    That time all worked fine 

    Thanks,

    Raghuraman.Shanmugam

     

    1. Jun 18, 2009

      Pascal Martin says:

      For me it work great with Hudson 1.310 , Selenium HQ plugin 0.2 and selenium-ser...

      For me it work great with Hudson 1.310 , Selenium HQ plugin 0.2 and selenium-server-1.0-beta-2

      What are your job log, (They hava error or warning ?)

      1. Jun 19, 2009

        raghuraman.shanmugam says:

        Hi Pascal, Could you please tel me Where to find job log and other stuffs might...

        Hi Pascal,

        Could you please tel me Where to find job log and other stuffs might be needed for investigation?

        Thanks!

        1. Jun 19, 2009

          Pascal Martin says:

          1- In your job Main Page Click on the build is failed 2- Click on Console Outp...

          1- In your job Main Page Click on the build is failed

          2- Click on Console Output

          3- Now you can see the job log

          Normally you find something like

          [main] $ java -jar C:\selenium-server.jar *************
          04:02:06.987 INFO - Java: Sun Microsystems Inc. 11.0-b16
          04:02:06.987 INFO - OS: Windows XP 5.1 x86
          04:02:06.987 INFO - v1.0-beta-2 [2571], with Core v1.0-beta-2 [2330]
          04:02:07.137 INFO - Version Jetty/5.1.x
          04:02:07.137 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
          04:02:07.157 INFO - Started HttpContext[/selenium-server,/selenium-server]
          04:02:07.157 INFO - Started HttpContext[/,/]
          04:02:07.187 INFO - Started SocketListener on 0.0.0.0:4444
          04:02:07.187 INFO - Started org.mortbay.jetty.Server@109a4c
          04:02:13.231 INFO - Preparing Firefox profile...
          04:02:15.734 INFO - Launching Firefox...
          04:02:17.657 INFO - Checking Resource aliases
          06:06:02.048 INFO - Checking Resource aliases
          06:06:02.048 INFO - Received posted results
          06:06:03.850 INFO - Killing Firefox...
          Tests failed, see result file for details: *******************
          06:06:04.942 INFO - Shutting down...
          Publishing Selenium report...
          Test failures: 22
          Test totals : 237

          1. Jun 23, 2009

            raghuraman.shanmugam says:

            Hi Pascal,  Hudson : 1.306 Selenium RC server : selenium-server-1.0-beta-...

            Hi Pascal,

             Hudson : 1.306

            Selenium RC server : selenium-server-1.0-beta-2

            HQ plugin : 0.2

            Error log :

            Started by user anonymous
            [workspace] $ java -jar d:\SeleniumRC\selenium-remote-control-1.0-beta-2\selenium-server-1.0-beta-2\selenium-server.jar -htmlSuite *firefox http://www.google.co.in/ig?hl=en d:\Google\googleTest.html report.html
            17:25:19.756 INFO - Java: Sun Microsystems Inc. 11.3-b02
            17:25:19.756 INFO - OS: Windows XP 5.1 x86
            17:25:19.756 INFO - v1.0-beta-2 [2571], with Core v1.0-beta-2 [2330]
            17:25:19.910 INFO - Version Jetty/5.1.x
            17:25:19.910 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
            17:25:19.910 INFO - Started HttpContext[/selenium-server,/selenium-server]
            17:25:19.910 INFO - Started HttpContext[/,/]
            17:25:19.922 INFO - Started SocketListener on 0.0.0.0:4444
            17:25:19.922 INFO - Started org.mortbay.jetty.Server@201f9
            17:25:19.961 WARN - It looks like your baseUrl (http://www.google.co.in/ig?hl=en) is pointing to a file, not a directory (it doesn't end with a /). We're going to have to strip off the last part of the pathname.
            17:25:20.088 WARN - It looks like your baseUrl (http://www.google.co.in/ig?hl=en) is pointing to a file, not a directory (it doesn't end with a /). We're going to have to strip off the last part of the pathname.
            17:25:20.318 INFO - Preparing Firefox profile...
            17:25:26.349 INFO - Launching Firefox...
            17:25:30.411 INFO - Checking Resource aliases
            17:55:27.272 INFO - Killing Firefox...
            HTML suite exception seen:
            org.openqa.selenium.server.SeleniumCommandTimedOutException
            at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:102)
            at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:141)
            at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:632)
            at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:236)
            at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:194)
            17:55:27.552 INFO - Shutting down...
            Archiving artifacts
            Publishing Selenium report...
            ERROR: Test reports were found but none of them are new. Did tests run?
            For example, C:\Documents and Settings\RAGHURAMAN.SHANMUGAM\.hudson\jobs\Job1\workspace\report.html is 4 days 20 hr old
            Finished: FAILURE
             
            I am not able attach screen ... problem with the server....
            I try to attach in near future

            1. Jun 23, 2009

              Pascal Martin says:

              Check if the command line stated by hudson (SeleniumHQ plugin ) is correct (j...

              Check if the command line stated by hudson (SeleniumHQ plugin ) is correct
              (java -jar d:\SeleniumRC\selenium-remote-control-1.0-beta-2\selenium-server-1.0-beta-2\selenium-server.jar -htmlSuite *firefox http://www.google.co.in/ig?hl=en d:\Google\googleTest.html report.html)
              1-In a batch window of Windows paste the command and run
              2-Check the test start - execute and end normally
              3-Check the result file

              Y receive the same error SeleniumCommandTimedOutException when the selenium test not starded correctly by selenium-server.
              Or the test need human action to make test continue.

              Other cause, your testsuite is to long to execute
              add extract param in other box of plugin like '-timeout 7200' for a timeout of 2 hours

              The log you write say the SeleniumHq plugin run correctly but the selenium-server.jar not make the result file correctly because he reach a timeout.

              1. Jun 25, 2009

                raghuraman.shanmugam says:

                Hi Pascal, Google page should be opened in the bottom window but it has been...


                Hi Pascal,

                Google page should be opened in the bottom window but it has been opened at the place where testcase is being displayed in the top window.

                This issue seems very weird am not able to fix this never the less I tried your suggestions too...

                 Please help me out.

                Thanks!


                1. Jun 25, 2009

                  Pascal Martin says:

                  Try with extra paramter like -avoidProxy if it not work go to seleniumhq forum f...

                  Try with extra paramter like -avoidProxy if it not work go to seleniumhq forum for extra help on selenium-server. When you are able to start selenim-server correctly in command line configure the hudson seleniumhq with the same parameter and it is supposed to work.

                  1. Jul 04, 2009

                    raghuraman.shanmugam says:

                    Hi Pascal, I did a stupid mistake that I had given Testcase file instead of Tes...

                    Hi Pascal,

                    I did a stupid mistake that I had given Testcase file instead of Testsuite file in config page of Hudson job, so  it was not running.

                    Now all working fine.

                    In future if any body faces same problem I had, Please ask them to check whether it is Testsuite or Testcase in the config page of a Hudson job

                    Thanks for the support

  6. Jun 24, 2009

    Jean-Marc Trémeaux says:

    Is it possible to run a set of tests ? e.g. <selenese files="c:\absolute...

    Is it possible to run a set of tests ?

    e.g.
    <selenese
    files="c:\absolute\path\to\my\test*.html"
    I don't want to maintain a test suite manually.

    Thank you

    1. Jun 25, 2009

      Pascal Martin says:

      SeleniumHQ htmlSuite Run not support this feature. To resolve this, make a pag...

      SeleniumHQ htmlSuite Run not support this feature.

      To resolve this, make a page web (php,asp,..) which builds the test suite and use this url for the test suite in the plugin.

      1. Jun 25, 2009

        Jean-Marc Trémeaux says:

        Yep that's what I do (via an Ant script). I would like to remove that extra ste...

        Yep that's what I do (via an Ant script).

        I would like to remove that extra step to make Selenium integration easier.

        1. Jun 25, 2009

          Pascal Martin says:

          You can make update on the seleniumhq plugin to add one buildstep that make a ht...

          You can make update on the seleniumhq plugin to add one buildstep that make a htmlSuite from pattern send me the code and y integrate in the next version.

          1. Jun 25, 2009

            Jean-Marc Trémeaux says:

            Pascal: I use Seleniumhq Plugin only to publish the test results, not to run the...

            Pascal: I use Seleniumhq Plugin only to publish the test results, not to run the tests. For this I use an Ant task. The reason is I want to to run the tests BOTH from the developer's platform and from the CI server.

            I aknowledge the lack of a fileset attribute is a problem from selenium HQ, not the plugin so I should rather contribute to them. What do you think?

            1. Jun 25, 2009

              Pascal Martin says:

              To make Selenium integration easier, it possible to make you extra step by the s...

              To make Selenium integration easier, it possible to make you extra step by the seleniumhq plugin.
              You can also make custom task in Ant Task, and contribute your work in selenium HQ.

              I think the second option is better in you case. (Many people, have same requirement)
              http://jira.openqa.org/browse/SRC-599
              For people they not use Ant the first option is better.

  7. Nov 12

    Victor Doulepov says:

    Did anybody experience resource conflicts - when multiple SeleniumHQ tasks attem...

    Did anybody experience resource conflicts - when multiple SeleniumHQ tasks attempt to use the same browser / Selenium server JAR?
    My example: two builds complete closely in time, both start (different) SeleniumHQ smoketests using *iexplore, with a 90% probability neither of the test won't complete to success. After this:
    ==
    12:16:30.712 INFO - Java: Sun Microsystems Inc. 14.1-b02
    12:16:30.712 INFO - OS: Windows XP 5.1 x86
    12:16:30.728 INFO - v1.0.1 [2696], with Core v (VERSION) [@REVISION@]
    12:16:30.931 INFO - Version Jetty/5.1.x
    12:16:30.931 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
    12:16:30.931 INFO - Started HttpContext[/selenium-server,/selenium-server]
    12:16:30.931 INFO - Started HttpContext[/,/]
    12:16:31.181 INFO - Started SocketListener on 0.0.0.0:4332
    12:16:31.181 INFO - Started org.mortbay.jetty.Server@dbe178
    12:16:33.853 INFO - Launching Embedded Internet Explorer...
    12:16:34.884 INFO - Launching Internet Explorer HTA...
    ==
    nothing happens. A fantom iexplore.exe process is reported by the task manager; all further attempts to run SeleniumHQ steps with *iexplore also fail until this process is killed.

    Workarounds:
    1. Spread the SeleniumHQ runs in time. Ensure no overlapping.
    2. Use the Build Timeout plugin to abort the stuck job. I'm not sure whether this will correctly kill the stuck browser process though.


    Question closed (follow the answer of Selenium Grid team)

    Selenium Grid does not officially support running multiple Internet Explorer on a single Windows machine. This is mostly because:
    • People who know IE better than I do (Dan Fabulich) tell me that if you run 2 browsers as the same user in HTA mode they end up sharing a singleton instance in memory, which could cause problems.
    • The *iexplore mode is changing the registry settings at each session start/end to have IE use a specific Remote Control as HTTP proxy. If you run multiple Remote Controls at the same time you can see the problems coming!

    Currently, the only robust solution for running multiple IE instances on a single machine with Selenium Grid is to use virtualization (multiple VMs, a single IE instance per VM).

    1. Nov 12

      Pascal Martin says:

      Other solutions is use only one job executor to force job to run in sequential o...

      Other solutions is use only one job executor to force job to run in sequential order.

      Also you can use job dependency to force one job to run after en other
      Ex: Selenium job2 is started after Selenium job1 ending

  8. Feb 04

    Offroy Jerome says:

    How to use slave machine to run test suite ? I've got a lot of problems making ...

    How to use slave machine to run test suite ?

    I've got a lot of problems making it working

    is there a tutorial ?

    How do configure selenium-server.jar path in order to allow the slave to access it ? (copy it on slave manually ?)
    How do create a selenium test suite that will make the slave be able to locate each tests (currently path are relative in TestSuite file) ?

    thanks in advance

    1. Feb 18

      Pascal Martin says:

      How do configure selenium-server.jar path in order to allow the slave to access ...

      How do configure selenium-server.jar path in order to allow the slave to access it ? (copy it on slave manually ?)

         The selenium-server.jar need to be installed in exactly same directory configured in (via Manage Hudson -> Configure System)

      How do create a selenium test suite that will make the slave be able to locate each tests (currently path are relative in TestSuite file) ?

        Normaly each tests of the test suite need to be in http server you test (startUrl)