Selenium RC start() method launching extra browser tab with chrome location from java 11.0.11 - selenium-rc

Recently upgraded to java 11.0.11.
We are using Selenium server standard 2.32.0.jar for server.
By Running test case chrome launching extra browser tab with chrome location from java 11.0.11
To run server using "java -jar selenium-server-standalone-2.32.0.jar -singleWindow"
Selenium selenium = new DefaultSelenium("localhost", 4444 , "googlechrome", "http://www.calculator.net");
selenium.start(); // Start
Expected is browser should launch single window.

Related

Unknown option: -Dwebdriver.chrome.driver when running selenium server standalone on Mac

I was trying to manually run selenium server standalone on MAC and then run my tests with intern-runner in Chrome browser. As I've been advised on intern User Guide:
"To use ChromeDriver and IEDriver with a Selenium server, the driver executable must either be placed somewhere in the environment PATH, or their locations must be given explicitly to the Selenium server using the -Dwebdriver.chrome.driver (ChromeDriver) and -Dwebdriver.ie.driver (IEDriver) flags upon starting the Selenium server."
I started the Selenium server and put path to chrome driver on my machine, but got error:
"Unknown option: -Dwebdriver.chrome.driver"
any idea on why seleinum unable to recognize the options?
Is there any other solution on how to run chrome webdriver/IE webDriver from command line with selenium standalone server?
Where the driver executable could be placed in the environment PATH on MAC?
I was able to run chrome driver separately with out any issues using:
./node_modules/.bin/chromedriver --port=4444 --url-base=wd/hub
For selenium3 you need to use Dwebdriver.chrome.driver option first.
java -Dwebdrive.chrome.driver=path_to_chrome_driver -jar selenium_server_file
To avoid any path issues better download both files in the same directory and run from there.
Example:
java -Dwebdrive.chrome.driver=chromedriver -jar selenium-server-standalone-3.0.1.jar
Also have Chrome browser installed.
Is drive instead of driver

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

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

selenium UI automation through Teamcity build agent

We are running selenium UI automation through Teamcity build Agent but it couldnt launch firefox and the error is below:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host localhost.localdomain on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: :0.0
Error: cannot open display: :0.0
Before trying with Teamcity build agent , we have executed the selenium cases manually (by running the ant script) in the build agent VM and it could launch firefox and executed the cases successfully.
so, we don't see any problem of compatibilty between firefox and selenium jar version.
It seems like your configuration misses a virtual display.
You need a virtual display if you want to run selenium with a browser such as Firefox, IE, ..., without any display. You could use Xvfb for that, or headless browser such as phantomJS.
There are a lot of articles about that, like this one
Or you could export your display to a monitoring environment, if you want selenium tests to be displayed while they run.

[Selenium]Arbitrary error with Firefox Binary

I'm running some automated Selenium tests on my Debian server, every hour.
But, randomly, I have this error :
Failed to connect to binary
FirefoxBinary(/usr/lib/iceweasel/firefox-bin) on port 7071;
I run Selenium with a jar file, and I'm using Xvfb as my server is headless.
DISPLAY=:7 java -jar /selenium/SeleniumTest.jar
I wasn't able to tell why it happens (about 2 times each 5 runs).
Does someone have an idea of what is going on ?
EDIT :
Selenium : Selenium Java 2.21.0
Firefox : Mozilla Iceweasel 3.5.16
Debian : 6.0.4

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