Setting user extensions when the Selenium Server has been started dynamically

I hope this helps someone someday, I needed to set user extension for a selenium test suite, dynamically in the code as i was starting the Selenium server via same.

public void startSeleniumServer(String port) {
	rcc = new RemoteControlConfiguration();     
	try { 
		 	seleniumServer = new SeleniumServer(false, rcc);
	 	} catch (Exception e) {
	 		throw new IllegalStateException("Can't start selenium server", e);  

	 public void stopSeleniumServer() {
	 	if (seleniumServer != null) {

I was setting the user extension file using the remoteControlConfiguration object so i had typed:

rcc.setUserExtensions(new File({path_location_to_user_extension.js}));

This didnt work and an extensive search in the api wasnt very useful. A colleague however found out that doing a


would make the user-extension file to work. Great isn’t it ………..

You Might Also Like
comments powered by Disqus