Error using SelBlocks extension with Selenium server - selenium

I've been recording/writing Selenium html scripts using the SelBlocks extension. Now we're going to use Selenium server to run the tests in different browsers.
I tried getting the javascript from the SelBlock xpi by extracting it and reference that javascript in my selenium server bat file. When I try to run my bat file with referencing the javascript, i got the error "Line: 777 Error: 'XML' is undefined" when I run it in Internet explorer. This happens as the test script is loaded in TestRunner.
When I try to run it in Firefox, TestRunner hangs just prior to running the script.
i'm using Selenium Server 2.1, Firefox 5 and IE8.

Selblocks is only supported for Selenium IDE. See note about "no language translation" here: Selblocks documentation. Although automated translation would be an interesting area of investigation...

I've tried the same thing (Firefox 4.0, Firefox 7.0, selenium-server-2.0.5.jar, SelBlocks 1.3 installed as a firefox plugin).
Since the -userExtensions way didn't work for me, I installed SelBlocks 1.3 in the firefox profile I use with -firefoxProfileTemplate and -htmlSuite. It looks like selenium server doesn't do anything.
After more than a minute I have:
so even the selenium elapsed timer doesn't tick, and no line gets executed.
My simple test case is here.
Looks like I can't use SelBlocks with selenium-server[version].jar for now?

ANNOUNCEMENT: SelBlocks 2.1 now includes support for Selenium Server. Get the extension file here: https://raw.githubusercontent.com/refactoror/SelBlocks/master/user-extensions.js
Initial browser support is for firefox, googlechrome, and opera.

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.

Unable to run WebDriverIo tutorial

I'm trying to follow the WebDriverIo tutorial at http://webdriver.io/guide.html .
After setting up the Selenium server, when I try executing the test node script (step 7 in the tutorial), selenium warns me of some errors (see screenshot for full log), and I don't get any output returned.
Steps to reproduce:
I start the Selenium server
When I try running the node script, this happens (clock to zoom):
At this point a Firefox window opens automatically, and remains blank.
I'm running Firefox v52 and Selenium 3.0.1. I downloaded Geckodriver from https://github.com/mozilla/geckodriver/releases
Any obvious thing that I'm missing? I'm very new to Selenium and browser automation, forgive the generic input :)
If you have been here to get your Windows release of gecko driver : https://github.com/mozilla/geckodriver/releases, you may have miss this message :
"IMPORTANT: If you use geckodriver with Selenium, you must upgrade to
Selenium 3.3 since this release aligns HTTP responses with the
WebDriver standard."
(I can see you are in v3.0.1).

How to run the selenium code on linux using firefox without GUI?

I had redhat Linux server command line but there is no GUI for that and I need to run selenium code on this server with firefox. As I am new to selenium so I am not sure whether it will work or not.
For achieving this I had install Firefox on my Redhat linux machine successfully but not able to trigger that as it is showing no display found.
Is there any other way to achieve this for headless browsing, where virtually a firefox will be opened and selenium code can be executed without GUI. Is it possible to do??
You can use HtmlUnitDriver of selenium to use headless browsing but it will not open firefox and may be not loading all content to it's cache as same as firefox
Refer Below:-
https://code.google.com/p/selenium/wiki/HtmlUnitDriver
Another thing you can use is Phantomjs with selenium Webdriver. This is most using pattern by industries for headless browsing
Refer below:-
http://www.guru99.com/selenium-with-htmlunit-driver-phantomjs.html
Yes you can trigger selenium file using command line
http://www.tutorialspoint.com/testng/testng_executing_tests.htm
Bash file is running fine in windows for testng but it is not working in linux/mac
Now if still your firefox is not opening then it is basically issue of some setting with your OS with firefox
Refer that too :-
https://serverfault.com/questions/279036/open-terminal-via-ssh-run-firefox-display-not-found
May be you have problem with some permission in red hat
Hope it will help you :)

Error in running test case using batch file via selenium IDE

I used Selenium IDE firefox plugin to record a test case then i used '.bat' command line to automate testing using the below command,
java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -htmlSuite "*firefox" "http://16.52.110.123:8080/AntExample/userRegistration.htm" "C:\Selenium\First_Test_Real_Suite.html" "C:\selenium\logs\Result.html"
the test was perfectly working using the .bat script when suddenly today I am facing this error message in firefox when I run the script
Firefox can't find the file at
chrome://src/content/TestRunner.html?auto=true&multiWindow=true&defaultLogLevel=info&baseUrl=http://16.52.110.123:8080/AntExample/userRegistration.htm&resultsUrl=http://localhost:4444/selenium-server/postResults&test=http://localhost:4444/selenium-server/tests/First_Test_Real_Suite.html.
I am all ears to fix this issue
You are getting this issue due to latest Firefox browser update :)
First Download and Install Previous Firefox Browser Version 42.0 (Link
: Click here)
and Try to execute same Selenium Test cases using Bat file. It will work properly. :)
Also after Installing Firefox browser, Don't forgot to set following option
Goto Tools >> Options >> Advanced Tab >> Update Tab >> select "Never
check for updates (not recommended: security risk)" option to disable
auto update.
Running Selenium Test cases using bat file will work properly once new "Selenium Standalone Server" version get released (Current version is 2.48.2 will work for Firefox 42.0)
upgrade/downgrade to FF 42.0 fixed the error. Thnx guys
This is indeed because Firefox 43 doesn't allow you to run unsigned add-ons. If you insist on using the old Selenium RC Runner and want to run the latest Firefox, you can enable add-ons again by allowing for unsigned add-ons:
In Firefox go to about:config
Look for setting xpinstall.signatures.required and toggle it to false
Now any unsigned add-on will run, including the Selenium RC Runner. Use it at your own risk ;-)

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