如何在Jubula或RCP测试工具中注入参数?

时间:2022-01-07 10:57:17

I want to test my RCP application with GUI tests. I've found two possible tools: Jubula and RCP Testing Tool.

我想用GUI测试来测试我的RCP应用程序。我找到了两种可能的工具:Jubula和RCP测试工具。

Does anybody know, how to inject parameters into the tests, so that I can use one test case with multiple inputs?

有谁知道,如何将参数注入测试中,以便我可以使用一个具有多个输入的测试用例?

3 个解决方案

#1


You can add parameters to parameter contexts, unite it to super context, add context to test case and then use it as $parametername in test case script.

您可以向参数上下文添加参数,将其与超级上下文联合,向测试用例添加上下文,然后在测试用例脚本中将其用作$ parametername。

In RCPTT if a test case refers to more that one supercontext, then all possible combinations of tuples from these supercontexts will be used.

在RCPTT中,如果测试用例引用的是超过一个超级上下文,那么将使用来自这些超级文本的所有可能的元组组合。

There are good examples in the mentioned documentation.

在上述文档中有很好的例子。

#2


I found a way for the RCP Testing Tool: https://www.eclipse.org/rcptt/documentation/faq/pass-value/

我找到了RCP测试工具的方法:https://www.eclipse.org/rcptt/documentation/faq/pass-value/

  1. Add the parameter you want to include in your test to the aut vm arguments like -DpropertyName=propertyValue
  2. 将要包含在测试中的参数添加到aut-vm参数,如-DpropertyName = propertyValue

  3. Use the ECP function get-java-property "propertyName" to get the value of the passed property
  4. 使用ECP函数get-java-property“propertyName”获取传递的属性的值

#3


You have to use the Data Set feature. It's basically a table with each row meaning a separate cycle of the same Test Case repeated.

您必须使用数据集功能。它基本上是一个表,每行意味着重复相同测试用例的单独循环。

The columns of the table are named after the parameters of the Test Cases.

表的列以测试用例的参数命名。

You can also use Excel files (.xls) as Data Set source.

您还可以使用Excel文件(.xls)作为数据集源。

#1


You can add parameters to parameter contexts, unite it to super context, add context to test case and then use it as $parametername in test case script.

您可以向参数上下文添加参数,将其与超级上下文联合,向测试用例添加上下文,然后在测试用例脚本中将其用作$ parametername。

In RCPTT if a test case refers to more that one supercontext, then all possible combinations of tuples from these supercontexts will be used.

在RCPTT中,如果测试用例引用的是超过一个超级上下文,那么将使用来自这些超级文本的所有可能的元组组合。

There are good examples in the mentioned documentation.

在上述文档中有很好的例子。

#2


I found a way for the RCP Testing Tool: https://www.eclipse.org/rcptt/documentation/faq/pass-value/

我找到了RCP测试工具的方法:https://www.eclipse.org/rcptt/documentation/faq/pass-value/

  1. Add the parameter you want to include in your test to the aut vm arguments like -DpropertyName=propertyValue
  2. 将要包含在测试中的参数添加到aut-vm参数,如-DpropertyName = propertyValue

  3. Use the ECP function get-java-property "propertyName" to get the value of the passed property
  4. 使用ECP函数get-java-property“propertyName”获取传递的属性的值

#3


You have to use the Data Set feature. It's basically a table with each row meaning a separate cycle of the same Test Case repeated.

您必须使用数据集功能。它基本上是一个表,每行意味着重复相同测试用例的单独循环。

The columns of the table are named after the parameters of the Test Cases.

表的列以测试用例的参数命名。

You can also use Excel files (.xls) as Data Set source.

您还可以使用Excel文件(.xls)作为数据集源。