running selenium test suites created by selenium ide (firefox) over command line (ubuntu) - firefox

I have the problem that my selenium tests created via the firefox plugin "Selenium IDE" won't work when executed over cli with htmlsuite command. The test should simply open google.de in firefox browser.
I can record and execute the test just fine in selenium ide, but when i execute the following command in cli:
java -jar /var/lib/jenkins/jobs/SuiteCRM_CI_Test/selenium-server-standalone-2.48.2.jar -debug -log /home/jenkins/wtflog.log -firoxProfileTemplate /var/lib/jenkins/jobs/SuiteCRM_CI_Test/firefox_profile -htmlSuite *firefox http://google.de /home/koschig/Arbeitsfläche/seleniumtests/googlesuite.html results.html
All that happens is, firefox will be opened with 2 tabs: one being the firstrun" tab and the other is the following:
chrome://src/content/TestRunner.html?auto=true&multiWindow=true&defaultLogLevel=info&baseUrl=http%3A%2F%2Fgoogle.de&resultsUrl=http://localhost:4444/selenium-server/postResults&test=http%3A%2F%2Flocalhost%3A4444%2Fselenium-server%2Ftests%2Fgooglesuite.html
which gets me an error, file not found
Well, I don't know where the first half of this url comes from, the second half is crafted with the parameters I wrote in the command line.
Does anyone know how to solve this problem? I expected that firefox will be opened and google.de will be accessed...

Related

Jenkins : Selenium GUI tests not visible in browser when I click build w/o using command prompt

I simply want to navigate to Jenkins, click build, and see the test execution in the browser. I don't want to use the command java -jar jenkins.war in the command prompt to get the browser to appear when I run my automated test. Any possible solutions?
They have a solution here
Solution 1: Enable "Allow service to interact with Desktop"
Tried it, it didn't work on my machine running in Windows 10
Solution 2: Through CMD using jenkins.war

Nightwatch starts selenium and then hangs indefinitely

I'm running a simple nightwatch test on a Windows 10.1 machine. The tests starts up selenium server (e.g., selenium server... started - PID: 12784), but it never gets to the test code. I can use a browser to get to the localhost server page that is spawned from the "node nightwatch.js -t test.js" command, so I know the server is working properly. I've also tried running nightwatch with different browsers, e.g., -e chrome, firefox, IE, and phantomjs, and none of them work. Putting --verbose on the command doesn't provide any more console spew, so not sure how to debug this. I'm running with selenium-server-standalone v2.53.0.
Any suggestions?
Solved my own problem. Turns out the problem was with incompatible versions of node, nightwatch, and python. I figured it out by creating a totally separate clone of my repository and reinstalling all the node/nightwatch/selenium dependencies. Would be nice if there was a debug feature that could be enabled to indicate more details about where a node or nightwatch application is during application startup. I learned of node-inspector, so I'll check it out as a possible debug tool.

Selenium Web Driver does not work on xvfb

I want to run my Robot Framework tests which include Selenium2Library keywords on an Ubuntu remote machine so they should be run without a display. At first I just tried to run a simple test and get following result:
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
I installed xvfb in order the run headless tests and run these lines on remote shell:
sudo Xvfb :10 -ac
export DISPLAY=:10
Now i am getting the following error and I can't get rid of it
test | FAIL |
WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
I checked nearly all questions here about Selenium on xvfb and this specific error.
Since some mentioned about Selenium - Firefox incompability, I tried updating selenium (it is up to date, version 2.46.0), my Firefox was latest and i has not worked.
Then I tried using an old firefox relase (35.0) which is also not worked
Now I'm trying a solution for this problem and I am almost sure it is about fireofx.
Thanks for your answers and advices
EDIT:
->Runing tests with chrome works just fine
->Also i checked my iptables if there is a rule blocking network to local, it is in default state

Running Selenium IDE from batch file ignores user-extensions.js and selblocks. Why?

Hi I would really like to run a testsuite via the Selenium IDE, which I have started up with some custom commands in user-extensions.js and the SelBLocks extensions (for flow control)
with no success.
Is there a command that will start firefox and run the selenium plugin with the suite and baseurl as an argument?
I have had better luck with running the suite with the following command in a batch file (with suitable values for the baseurl, suite & logfile:
java -jar selenium-server-standalone-2.32.0.jar -htmlSuite "*firefox" "%baseurl%" "%suite%" "%log%" -port 4445
But the testrunner will die as soon as it encounters a command defined in user-extensions.js and/or a command from Selblocks.
Can anyone offer some clues to solving either of the above?
The IDE solution would be better (for me) as we do not have a great deal of java or webdriver talent here.
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.
Answering part of my own question here...
add the userExtension parameter to the java command to load the user extensions.
java -jar selenium-server-standalone-2.32.0.jar -userExtensions "path\to\user-extensions.js" -htmlSuite "*firefox" "%baseurl%" "%suite%" "%log%"
Still not sure how to get it to understand the selblocks commands though.

CentOS Selenium - Preparing firefox profile

I'm trying use to selenium with firefox on CentOS from command line like this:
java -jar selenium-server-standalone-2.19.0.jar -interactive
Then, I type:
cmd=getNewBrowserSession&1=*firefox&2=http://www.google.com
Then it stucks on "Preparing Firefox profile..." part and crashes:
13:59:13.105 INFO - Preparing Firefox profile... 13:59:33.366 ERROR -
Failed to start new browser session, shutdown browser and clear all
session data
Please help me solve this, I'm quite new to the unix world.
Thanks!
Are you pointing directly to the firefox executable, or are you pointing to an alias?
By default selenium should be pointing to your selenium binary, what is in /usr/bin is usually a script that interacts with the firefox executable.
you could define a specific firefox profile (you have to create it first):
java -jar selenium-server.jar -log SeleniumServer.log -firefoxProfileTemplate "PROFILEPATH" -interactive
And for those wondering, if you're at the command line, you can create a profile like this:
firefox -CreateProfile profilename

Resources