简体   繁体   English

将DBFit变量用于其他灯具

[英]Using DBFit variables for other Fixtures

Is it possible to use a DbFit variable in another fixture? 是否可以在另一个灯具中使用DbFit变量? For example, if I create a query in dbfit with a variable <<firstname as follows: 例如,如果我在dbfit中使用变量<<firstname创建查询,如下所示:

SELECT * FROM System.Columns Where ColumnName= 'FirstName' | <<firstname |

Is it possible to include a reference to that page in another suite of tests that use a column fixture or RestFixture and call the variable name to check against the database? 是否可以在使用列固定装置或RestFixture的另一组测试中包含对该页面的引用,并调用变量名称以对照数据库进行检查?

In the RestFixture, I'm checking a database column name against a node so can I do something like: 在RestFixture中,我正在针对节点检查数据库列名称,因此可以执行以下操作:

| GET | /resources/6 | | //${firstname}  |

Where I'm checking if an xml node named FirstName exists in the database. 我要检查数据库中是否存在名为FirstName的xml节点。

With fitSharp (.NET), it is. 使用fitSharp(.NET)可以。 With Java, I'm not sure. 对于Java,我不确定。

I was struggling with the same issue, imo it's hard to find any good documentation. 我在同一个问题上挣扎,imo很难找到任何好的文档。 I stumbled upon the answer skimming some arbitrary tests somewhere. 我偶然发现答案在某处略读了一些任意测试。

You can access the symbol in RESTFixture using %variablename% . 您可以使用%variablename%访问RESTFixture中的符号。

RestFixture 休息区

| GET | /resources/6 | | //%firstname%  |

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

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