0

I'm facing a problem with Fitnesse.

I have the following testcase with these steps.

  1. Generate XML
  2. send xml
  3. read answer
  4. return property from answer

I have another testcase that should use that return value.

Can I set a global variable that I can use in my whole testsuite? (Btw the return value is variable)

Thanks in advance.

Robert
  • 81
  • 7
  • *"I have another testcase that should use that return value."* In general: this is a bad test design. Don't create tests which depends on other tests. If you need to data for testing a certain case, then retrieve that data in the test method, even if you've done that before for a different test. – Tom Dec 12 '16 at 15:52
  • Are you using Slim of Fit? I just noticed your tags. So I assume Slim. – Fried Hoeben Dec 13 '16 at 11:48

1 Answers1

0

It sounds like a bit design-smell to pass data between tests. But maybe there is a good reason for doing so in your situation. If it is done in a SuiteSetUp or SetUp it might more expected.

You can store the property in a Slim Symbol and read that property in the other test. Or, least preferred approach, you can create your own static variable in a fixture and pass data using that.

Fried Hoeben
  • 3,247
  • 16
  • 14