简体   繁体   English

套件中的Fitnesse变量

[英]fitnesse variable in suite

I'm facing a problem with Fitnesse. 我遇到了Fitnesse的问题。

I have the following testcase with these steps. 我有以下步骤的测试用例。

  1. Generate XML 产生XML
  2. send xml 发送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. 提前致谢。

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. 如果在SuiteSetUp或SetUp中完成,则可能会更好。

You can store the property in a Slim Symbol and read that property in the other test. 您可以将属性存储在Slim Symbol中,并在另一个测试中读取该属性。 Or, least preferred approach, you can create your own static variable in a fixture and pass data using that. 或者,最不推荐使用的方法,您可以在灯具中创建自己的静态变量,并使用该变量传递数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM