Pergunta

--- TL;DR

At this point I suggest everyone to tied their Continuous Integration server/service to https://ghostinspector.com/

OLD QUESTION

after three days googling and testing I gave up, and I need help.

My objective is allow my co-workers to record one or more tests with Selenium IDE. Export them, upload them into a server, and get this server running these tests using the webdriver with htmlunit. As we build or fix the app, we will upload the tests to make out test library.

Record a test with Selenium IDE is okay. But getting it running is the problem. The machine we intend to let the tests is an linux amazon server. No front-end stuff, no kde, gtk, so no firefox, chrome, etc... This is why I've specified the htmlunit driver.

So far I wasn't able to get this task running even into my machine - Ubuntu 12.04 x86_64.

I downloaded the selenium-server tarball, and tried running:

java -jar selenium-server.jar -htmlSuite "*webdriver" "our.site.org" "/path/to/testsuite1.html" "/path/to/report1.html"

No success. Even changing the "*webdriver" (using other pops-up a browser screen).

I've tried running the server and the standalone server and connecting via browser.

I've tried PHP bindings by facebook.

I've tried PHPUnit and Testing Selenium classes - along with their respectives exported scripts from Selenium Formatters.

I really do not know where I'm slipping. Can anyone give me a safe direction, tutorial, etc, to follow with?

--- EDIT

Okay, my question may be resumed to:

What si the command line that would allow me to run selenese scripts with selenium-server, using the HtmlUnit driver?

Foi útil?

Solução 2

Have you read this blog post by David Burns (Automated Tester):

http://www.theautomatedtester.co.uk/tutorials/selenium/selenium_rc_setup.htm

He describes the way to run selenese tests using HTMLSuite.

We are going to use the HTMLSuite commands of the Selenium Remote Control. This allows you run your Selenese Test Suites as is. The command should look like java -jar selenium-servre.jar -htmlsuite . Browser could be : -*firefox -*chrome -*iexplore -*iehta -*safari -*custom /path/to/browser

The path to the test suite and the results file should be a full path.

Here is an example command; java -jar selenium-server.jar -htmlsuite *iexplore http://www.theautomatedtester.co.uk c:\testsuite\testsuite.html c:\testsuite\results.html

I would point out that htmlunit does not seem to be a supported option so I would expect to use -*custom and provide a path to htmlunit.

This is legacy functionality so there is a chance it doesn't work as expected any more. HTMLSuite expects the tests to be in Selenese (HTML table) format, you mention trying with the PHP binding, I would not expect this to work. If you do want to use some PHP bindings I would suggest using Adam Saunter's fork of the facebook bindings, they are the most up to date and best supported.

https://github.com/Element-34/saunter.php

Outras dicas

Are you using Continuous Integration? If so, you should consider getting a plugin to have your CI software run the Selenium tests. Works like a charm for me with Jenkins.

Considering your particular setup, you could both have the amazon linux server run the tests with HTMLUnitDriver, and declare other machines (with a GUI and proper browser) as "nodes" to run your test on other browsers.

Link to a tutorial

With Selenium WebDriver you can point to start a HtmlUnit in a already started node

In Java you'll do something like this:

IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), DesiredCapabilities.HtmlUnit());

To start the node just make sure to set browserName to 'htmlunit'.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top