Selenium RC does not open firefox on Ubuntu - selenium

When I use the Selenium RC 1.0.3 on windows everything works fine.
When I config the client to use selenium on Ubuntu 10.10 what happens is that the RemoteRunner is opening and showing Command History as if everything works fine, But the other window of firefox does not open hence the test does not run.
I"m pretty sure I misconfiged something on the server, But what is it?
Thanks.

You need to check what happens in RC's command line. If it opens firefox window, but doesnt navigate further - then you need to set firefox to use proxy with the same address and port as your RC. And if it doesn't open at all, then it probably doesn't know where firefox is located, so you need to pass path along with browser definition. This is done either in test case file, or if you use selenium grid, in grid_configuration.yml
*firefox /usr/lib/firefox-5.0/firefox.sh
upd. some say that shell scripts are not good with selenium

Related

FireFox still not working for Protractor/Selenium tests?

I have a project suite of automation tests that uses Protractor and Jasmine. As of a couple months ago, my tests stopped working in FireFox. Everything works perfectly in Chrome, and almost perfectly in IE.. because why would IE work ya know.
There have been multiple posts about this and I've read through all of them, but I haven't been able to determine if there's a workaround/solution to this. It's not entirely a HUGE deal if my tests run in FireFox, but with a web application it's mighty nice to be able to test all instances.
Basically what happens when I run a test in FireFox:
Command prompt acts like everything is about to run properly (FireFox driver starts up.. server remains running etc etc)
Firefox opens for a split second (icon appears on the task bar, browser flashes on the screen and closes)
After a good minute or so protractor gives me the following message:
[firefox #01-0] WebDriverError: Unable to connect to host XXX on port XXX
after 45000 ms.
With a ton of DEBUG lines referring to JSON files and Firefox addons.
Any thoughts or other sources I could check out would be sweet. Many thanks in advance.
Problem is with latest Firefox support from latest selenium-server. Use geckoDriver and it will work.
Follow this URL

How to disable firefox from opening while running test suite in Selenium IDE?

I am writing test scripts in Selenium IDE for my application but everytime when I run the test suite it opens up browser and performs all the actions and logs failures, if any. My requirement is to invoke the test script from command prompt using .bat file and generate a test report. I am able to do the same but the problem is firefox opens up and executes the test case one by one. Can anyone please suggest me how to disable Firefox window from opening up? Or is it just not possible to do so? Or do I need to switch to Selenium Webdriver in order to achieve my requirement? My application contains Ajax upto a lot of extent.
I have read many commands used in Selenium IDE but I could not find any command which can serve this purpose. Please suggest!
If you know any programming language supported by selenium-webdriver (Ruby, Java, Python, C#) then you should try PhantomJS WebDriver which allow to run scripts without opening visual browser session
Selenium-IDE are mean to invoke browser, that's how the script react to all the exact browser behavior.
Only selenium Webdriver allow you to run your browser under "Headless" mode, which in fact, put Firefox under X-virtual frame buffer in background, as above #Andersson suggested.
Unfortunately, there is no easy way to convert your Selenium-IDE script to your desire programming language at the moment.
If your concern is about "cluttered screen" in OS such as ubuntu, then your solution will be export the whole Selenium-IDE and firefox under another virtual X-display.

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

Using PhantomJS for Selenium's htmlsuite

Trying to port selenese commands from the Selenium IDE to a cron-usable task, and have gotten as far as getting these to run with Webdriver's HTMLSuite command using a local installation of Firefox. However, we need these to run without opening a visual browser - as we're already using PhantomJS elsewhere in the application this seemed like the logical option rather than going down the XVFB route.
Is this possible? I've tried a variety of commands but keep getting errors of phantomjs not being an accepted browser.