Run selenium scripts in Internet Explorer - selenium-rc

I am currently using Selenium RC to run my scripts in FF in windows. Could you tell me how to run the scripts in IE as well?

Your question is not very clear, but assuming you mean you are using the Selenium IDE Firefox plugin to create your tests, you will find this blog post helpful.
You need java installed.
If you're on Windows you probably need to run the command as administrator.
Then run the following command as administrator
java -jar selenium-server-standalone-2.0b3.jar -htmlSuite "*iexplore"
"http://www.google.com" "TestSuite.html"
"results.html" -port 4445
where the parameter "*iexplore" specifies to use InternetExplorer.

Instead of using *firefox or *chrome in your script , use *iexplore or *iexploreproxy

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

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

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