Selenium Testrunner variables don’t work

6

I 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.

Posted in: Selenium

This article has 6 comments

  1. Kangs 10/27/2008, 12:12 am:

    Use storedVars['YourVariableName']

  2. nick 10/27/2008, 6:31 am:

    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.

  3. Vineet 12/16/2008, 4:20 pm:

    Hi,

    I am facing the same problem, did you figure out a solution yet?

    Thanks.

  4. Kuccinni 03/18/2009, 2:47 am:

    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

  5. Nick 04/18/2011, 7:59 pm:

    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}

  6. Vasanth 01/13/2012, 8:24 pm:

    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

Leave a Reply

Your email address will not be published. Required fields are marked *

*




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">