Adding User-Extensions to the Selenium RC server JAR file

Tags: 

I had trouble using the -userExtensions parameter in my RC batch file for including user-extensions. I also had trouble processing the instructions in the selenium documentation (found here: http://www.seleniumhq.org/docs/08_user_extensions.jsp#using-user-extensions-with-selenium-rc).

Instead of all the developer jargon, I simply cracked open the selenium-server-standalone-2.25.0.jar file using WinZip, and followed these instructions:

  1. Open the selenium-server-standalone-2.25.0.jar file using winzip an extracted the “user-extensions” file only to your C drive. So now you have the user-extansions.js in your C:\core\scripts folder.
  2. Edit the user-extensions.js by adding your extensions, just like you do with the IDE.
  3. Using Winzip again, add the modified user-extensions.js to the selenium-server.jar. For this,
    1. Open selenium-server.jar using Winzip.
    2. Use the “Add” button on the top bar of Winzip
    3. In the “Add” window, browse to C:\core\scripts\user-extensions.js file Make sure that the “Actions” choosen is “Add (and replace) Files” and “Save full path info” is checked in the “Folders” option.
    4. This will replace the user-extensions.js in the selenium-server.jar with our modified user-extensions.js with same path information.
  4. Close Winzip
    Now the new selenium-server.jar is ready with your own user-extensions.

No custom processor calls or instantiation needed.

Note, that some IDE user extensions do not work, without modification, with RC. In many cases, the developer usually provided a version for the IDE and a version for RC. If that is the case for the extension you are adding, make sure to copy in the right extension from the correct source.