Selenium Testrunner variables don’t work
6I have some tests where I store variables and they saved and work fine in the regular test build window. Specifically, I can store a variable in one test, then run another test afterwards and reference the variable for use. However, when the tests are run in Selenium’s Testrunner, the variables are inaccessible if not created in the current test. They do not save across tests in the Testrunner. Please comment if you have a solution. For now, I’ll be running all our tests from the build window.
Hi I'm Nick Bartlett and thanks for visiting my blog. I'm not much of a writer; many of my posts are short and to the point while others are meant to be a reference for myself and other web developers.
Use storedVars['YourVariableName']
Thanks for your input Kangs. I was using storedVars for the test runner instead of referencing by the dollar sign and they don’t work. I’m using firefox 2.0.0.17 if that makes any difference.
Hi,
I am facing the same problem, did you figure out a solution yet?
Thanks.
Hi there. I was facing the same problem. Thanks to Barry Simpson I solved this issue with his patch:
http://jira.openqa.org/browse/SEL-605
Until that patch is implemented…
I’m currently using the following workaround, which stores global variables using javascript:
getEval | user=”whatup”;
then in a seperate test…
type | j_username | javascript{user}
Hi,
I have a same question here.
It works well with the Firefox Selenium IDE plugin where in I created a test case with all variable declarations and use them in the following test cases. I’m wrote in an HTML format where I used Store function.
But this is not working in Selenium Testrunner core tool.
Could someone please help me out how to declare global variaables in one test case and use it in the rest of test cases run afterwards in Selenium Testrunner tool?
I appreciate your help,
Vasanth