Stored variables do not get passed between test cases in selenium-server-standalone-2.8.0. This might get fixed in the future but here is a work around for now that we used for our testing.
Test case 1 – Store the Google URL in the url variable
Test case 2 – open the Google URL stored in the previous test case
The url variable is empty in the second test.
In Windows, go to the directory of the selenium .jar file
1. Open the file (selenium-server-standalone-2.8.0.jar) with win RAR.
2. Go to core\scripts\selenium-testrunner.js
3. Open the file and search for the “startTest” function.
4. Move the following lines from the function “startTest” to the beginning of the function “startTestSuite”:
storedVars = new Object();
storedVars.nbsp = String.fromCharCode(160);
storedVars.space = ‘ ‘;
5. Save the File and let the system pass the changes to the .jar as well.
The ‘store’ command should work!
– by Thierry Sequeira