Is Selenium platform specific? - selenium

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).

Related

How can I test a Crosswalk application with BrowserStack?

At our company, we maintain a legacy Android application which uses Crosswalk to embed a web view. We would like to implement automated end-to-end tests for this app using Appium and ChromeDriver.
Unfortunately, the version of Chrome used by Crosswalk is modified in such a way that ChromeDriver cannot connect to it. This is a known issue, and the recommended workaround is to use a custom patched version of ChromeDriver instead.
This solution works for running tests locally. But BrowserStack doesn't seem to allow for supplying a custom build of ChromeDriver. I can choose from a set list of versions, but that won't help, as none of those versions have the Crosswalk patch.
Is there a way to make this work with BrowserStack?
I had used BrowserStack for my native app tests as well. Currently, they do not provide any custom capability to select the ChromeDriver version.

Differences between Selenium grid versions 1 and 2

Could someone please help me understand the difference between the remote control server in Selenium Grid 1 and the remote control server in Selenium Grid 2. From what I've read, one of the main differences between the versions is that version 2 of Selenium Grid was merged with Selenium Remote Control. Is this the same remote control as Selenium 1, that was responsible for proxy injection? as I thought this had been deprecated.
This is as of Selenium 3.4.0
We now have two separate artifacts.
For example if you head down to the Selenium downloads URL you would notice the following two artifacts
selenium-server-standalone-3.4.0.jar - This is the Grid (or Grid2 as you call it) as we know. This standalone jar can work in 3 modes viz.,
Hub - It acts as the hub standing in between your test and the actual node that gets the work done. Kind of like a postman/mailman and a match maker.
Node - This is the actual place where all the action happens. When running in this mode, it is responsible for getting automation requests from the tests routed via the Hub and opens up browsers, performs UI actions etc.,
Standalone - This is pretty much the same as Node but just that it doesn't require a Hub to route the automation test traffic to it. Tests can directly point at the Standalone and then start running. I believe this is perhaps the kind of setup that third party execution environment providers such as SauceLabs maybe using. (This is just a hunch, I don't know for sure).
selenium-html-runner-3.4.0.jar - This is where all the legacy stuff (or Selenium RC as you call it) has moved into. So if you had a html test suite that you created by recording a UI flow using Selenium IDE and wanted to run them from a command line (Note that you can always execute a html test suite from within the Selenium IDE and don't need anything extra), you would use this.
There is nothing called as Selenium Grid1 anymore. There's only Selenium Grid2 (which is the re-engineered version of Grid1).
The Selenium RC support exists only as a stop gap solution with no maintenance as part of selenium-html-runner-3.4.0.jar. This has been officially deprecated and there's no support for issues that surface on this.
The expectation is that if one were to be using Selenium and building new tests, then one should be directly using only the WebDriver APIs (which is Selenium2) and not fall back to using DefaultSelenium APIs (which is Selenium1)
Hope that helps!

Using Selenium without java runtime

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

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

Webkit browser & automation

Have anyone come across open source tools/framework for Webkit browser test automation?
There is (not tried) WebAii Automation Framework where the current Beta 2.0.0.1 has Safari 3 support added on windows (it's free but I don't think it's opensource).
If you want do it yourself:
On Apple you should be able to script it AppleScript or from
MAC OS X > 10.4: there is Automator
On Windows you might consider using P/Invoke and looking at the WinLauncher tool from WebKitTools
I haven't seen a framework to run the tests but if you're looking for input to test against there is Ian Hickson's adhoc and evil test suites in addition to the traditional acid tests.
Which WebKit? Selenium seems to have drivers for several WebKit-based browsers.
WebKit itself has a test suite, to be implemented by each platform, which the WebKit documentation calls DRT or DumpRenderTree (see also LayoutTestController).