I'm trying to start the selenium server by passing custom firefox profile to the DefaultSelenium constructor. It opens the browser with specified URL.
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*custom \"C:/Program Files/Mozilla Firefox/firefox.exe\"",ReadConFile.readcoFile("serverName"));
selenium.start();
the log is
16:39:19.246 INFO - Allocated session 4eb63d37a4ba4d2fb4e351f8f59e3ea6 for https://<myURL>, launching...
then it stays like that and server doesn't start.
however, this works fine if I don't use custom profile.
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*chrome",ReadConFile.readcoFile("serverName"));
selenium.start();
I need the launch custom profile as I've saved some site certificates necessary for https. Also, I'm executing this from eclipse.
I think my server isn't configured to launch custom profile. Please help me with this.
If you want to have
Fifefox
profile as default in your test:a) Download latest
selenium-server
: http://selenium-release.storage.googleapis.com/index.htmlb) Download latest
Firefox
c) Create
FF
profile (best in your custom directory) - in my case named "atf" https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profilesDefault directory where profiles are saved:
d) In my case I use
FF 36
andselenium-server-standalone-2.45.0.jar
Run
selenium server
:Then refer to it in your code:
If you want to refer to particular profile in your code (here I use default generated folder for profile named "myProfile"):
You can add certificates to custom profile
a) Run browser with custom profile
b) Add certificate
c) Remember to tick option in Firefox Preferences/Advanced/Certificates
Select one automatically
to avoid asking for accepting certificate every time as you access tested page
d) Restart browser
e) Navigate to page what will be tested and accept
User Identification Request
f) Close Firefox and enjoy custom profile with certificates available from selenium server :)
When you invoke the Selenium RC server, specify the path using the additional
-firefoxProfileTemplate
clause. For example -This will enable you to use all the bindings you have saved within the custom profile.
The start command is not really starting your selenium server per se, it's connecting your selenium object to an already running server with the browser of your choice.
To actually start the selenium [Jetty Web] server that sends / receives commands to your application under test via your specified browser, use a batch file and the switch rs79 is referring to. The contents of your batch file should include his line:
Now you have a true selenium server running on your dev machine (localhost) with the default "4444" port. This will specify that any Firefox browser testing will use this profile.
Now your DefaultSelenium constructor, assignment, and other calls can look like this:
Firefox will start using the custom profile specified in the batch file that starts the Selenium server, with your desired base URL, and then navigate into your desired application [URL]. If you are beginning your test from "http://www.server.com/" and not "http://www.server.com/myApp", you can omit the last open line.
You can also start the Selenium server in java see here.