0

I have following test suite structures in my mind:

  1. Test Suite 01, has one test case (TC01) in side.
  2. Test Suite 02, has one test case (TC02) in side.
  3. Variable file available and imported both Test suite as resource.
  4. Variable file has one List @{List}, with several values
  5. In TC01, I output the content of @{List}
  6. In TC02, I first Remove ${List} index 0, and set it as a new variable with same name: Remove From List ${List} 0, and then ${List}= Set Variable ${List}, Set Global Variable ${List}
  7. Then out put new ${List}

--> Everything works out correctly till then:

  1. After TC02 finished, I made RF perform TC01 again, and this time I think it should use new ${List} value, but it's not. Because Variable File has higher priority.

How can I made TC01 use new global variable ${List} later in second time? Is that possible?

Thank you very much in advance.

Daniel Chen
  • 1,933
  • 5
  • 24
  • 33

2 Answers2

2

Well, finally I solve this problem. Before reboot save the needed variable and value into sqlite db, and fetch them after reboot.

Daniel Chen
  • 1,933
  • 5
  • 24
  • 33
  • Yes, you need to serialize the state yourself, Robot Framework does not (and will not) support sharing state between different executions. – janne Sep 01 '11 at 04:26
0

What you are probably looking for is 'Set Suite variable'

See: http://robotframework.googlecode.com/svn/tags/robotframework-2.1/doc/libraries/BuiltIn.html#Set Suite Variable

or even 'Set Global variable'.

See: http://robotframework.googlecode.com/svn/tags/robotframework-2.1/doc/libraries/BuiltIn.html#Set Global Variable

Mark Irvine
  • 1,349
  • 14
  • 24
  • Hello Mark, as you can see in step 6, I've set global variable for my new ${List} variable. But truth is in order to re-perform TS01-TC01, I have to reboot the system, and after reboot, or variables were gone. – Daniel Chen Aug 29 '11 at 23:43