Using Selenium without java runtime - selenium

Is there a way I can use selenium without having to install java runtime on my remote machine?(the machine where the browser is)
The machine that automates the process( where the tests run will have java) but the remote machine where the browser is does not have java. is it possible? and if yes how ?

You can try using Launch4j for embedding JRE into your java application package.
Useful links:
1. Launch4J
2. A SO post for how to do it.
3. Another SO answer which describes how to do it on different OSes

Related

Selenium WDS executeScript()

I have a strange problem, which I'm unable to solve for sometime. I have a selenium WDS for Firefox browser. I tried to execute the code in JMeter UI, everything works fine. But when I try to execute the same in a server (using XVFB driver), I get the error:
rm="sun.org.mozilla.javascript.EvaluatorException: Can&apos;t find method org.openqa.selenium.remote.RemoteWebDriver.executeScript(string,org.openqa.selenium.remote.RemoteWebElement). (<Unknown source>#17) in <Unknown source> at line number 17"
All the required drivers are the same as the one I locally try. Yet, I get the error only when I run in the server but not locally. Please help
Most probably you have different versions of either WebDriver Sampler or dependency libraries, I don't see any other ways for the same script to work on one machine and don't work on another.
Install the same version of JMeter onto both machines (use JMeter 3.2 or later, whatever is available at JMeter Downloads Page)
Install latest version of the WebDriver Sampler plugin using JMeter Plugins Manager
Your test should now be running fine.

Automate testing with out installing anything on client machine

We have a requirement to automate testing on website with out installing anything on client machine(including with out running driver in client),
I have gone through grid model in selinum, but there we need to run webdriver on client machine which I can't do.
So, I need suggestions how can I automate web site with out installing or running jar or dll on client machine.
I am looking for any possibility injection of automation script from server machine to client.
Try Sikuli Automation tool.
you don't need to install sikuli application in your client machine.
Import sikuli libs with java program - http://sikulix-2014.readthedocs.org/en/latest/faq/030-java-dev.html
Export your program as executable jar and use it in your client machine

Will webdriver script compiled and run on windows will also run on ubuntu?

Currently I use to create and run scripts using java +eclipse+ junit+ webdriver in windows platform.Now if i shift to Ubuntu platform do i need to make any changes in configuration to run all supported browser.
Thanks
Yes it will work.But you need to check the browser for which scripts are designed.As it may be possible that you need to do code changes for web browser drivers for respective operating system.
Also make sure that all the software's java/eclipse/junit/web driver are configured on the linux machine.

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

Is Selenium platform specific?

Is Selenium paltform specific. If yes then how can I develop a cross-platform specific application with it by first identifying the platform and then call the platform-specific selenium routines.
The IDE is a firefox plugin, but you can develop tests in multiple languages, which run on and against multiple platforms (including multiple browsers). Not really sure what you're trying to accomplish, but hopefully that helps.
Selenium is platform independent. This is because you run a Selenium RC server (which is a java application and hence can be run on any platform). Then you send selenese commands to the server which controls the testing activity on the browser. To send the selenese commands you can use any language (such as Java, PHP, Ruby etc). Now this again does not limit you in any way to a certain OS.
If you are using the Firefox plugin IDE to run the test cases then of course the platforms supported would be limited to platforms supported by Firefox.
Hope that answers.
I may be misunderstanding your question, but:
With Selenium RC (or Grid, more specifically), you can specify what platform you want your test to run on. Each node registers with the hub under a particular platform, and each test's DesiredCapabilities can request a platform.
As the other answers have stated, Selenium itself is platform independent but you can run your tests on a by-platform by-browser basis. Either way, the tests (in theory) should look the same and use the same native Selenium commands.
I am not so familiar with Selenium, but it looks to me that it works almost everywhere where you can install Firefox 2+.
Platforms Supported by Selenium
I'm using Selenium for a project that runs under Windows and Ubuntu. The only platform specific code is for starting the environment where it executes (headless X server under Ubuntu) and starting the Selenium jar file. The rest is all platform independent. I don't know if this will also work as smoothly when you try to use different browsers (I'm using Firefox on both platforms).