Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium testing machine

--- 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?

like image 908
Davis Peixoto Avatar asked Feb 25 '13 18:02

Davis Peixoto


People also ask

What is Selenium testing tool?

Selenium is an open-source tool that automates web browsers. It provides a single interface that lets you write test scripts in programming languages like Ruby, Java, NodeJS, PHP, Perl, Python, and C#, among others.

Which tool is best for Selenium?

JUnit is a popular framework that offers in-built reporting for the Selenium Tests. The JUnitHTMLReporter within the JUnit Reporting tool provides detailed reports about the test results.

Is Selenium a QA tool?

It's used to ensure high-quality web applications — whether they are responsive, progressive, or regular. Selenium is an open-source tool. And, Selenium releases regularly. Testers like using Selenium because it's easy to generate test scripts to validate functionality.

What is the salary of a Selenium tester?

Selenium Automation Tester salary in India ranges between ₹ 4.0 Lakhs to ₹ 15.5 Lakhs with an average annual salary of ₹ 7.0 Lakhs. Salary estimates are based on 184 salaries received from Selenium Automation Testers.


2 Answers

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

like image 113
Silver Quettier Avatar answered Nov 15 '22 16:11

Silver Quettier


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

like image 41
Ardesco Avatar answered Nov 15 '22 17:11

Ardesco