如此翻译-2

上一篇 / 下一篇  2007-09-06 15:58:45 / 个人分类:英语

为了应付技术面试,这些日子正在恶补TestDirector/QualityCenter的知识。除了查看TD/QC自带的资料以外,也浏览了网站和论坛上面的一些文章。前两天看到了一篇帖子,标题很吸引人“TD中Case的复用”。细细读来,发现文中的不少句子都很别扭。看到的是通篇中国字,连接起来却不像通顺的中国话!遇到这种情况,我会很自然的联想到文章可能译自外文资料。按照文中的关键字上网搜索一下,果然这篇文章是译自TD用户手册的一个章节。简单的一段文字,翻译成这个样子。把译文和原文都贴出来,对比一下看看多少错误。

[译文] TD中Case的复用

在你设计的测试步骤里,可以调用其他手工测试。当你运行测试时,测试步骤中调用的测试作为这个测试的一部分。这种方法很有用,例如,如果你使用了测试模板,你就可以在不同的测试中重复使用。
为了增加一个测试的适应性,你可以在测试中添加参数,然后在测试中调用它。参数是一个变量,它可以替换特定的测试中分配给它的一个定值。你可以根据调用它的测试或一个测试集在不同的场所下来改变参数的值。
例如,你可以创建一个“Login_Template”,它记录了当启动应用程序时登录的用户名及密码信息。你需要在多个测试的开始调用这个“Login_Template”。但在一些案例中,你需要用不同的用户比如administrator 登录。因此你要创建两个参数<<user name>>和<<password>>,根据不同的调用“Login_Template”的测试来改变这些参数的值。如果所有的调用都是使用一个用户登录,你可以为这个参数的用户及密码设置一个默认值。
[注:这段话翻译的最离谱,乱七八糟的内容已经丝毫看不到原文的思路了。]

这个部分包括了下面几个方面:
一、创建测试模板
test plan tree中你可以定义一个手工测试为测试模板。一个测试模板通常包含了参数,它可以被不同的测试调用。
注意:把一个测试设成一个测试模板来使用只是一个过滤的目的。你不需要设置一个测试为测试模板仅仅为了能被调用或添加参数。
To create a template test:
在test plan tree中右击一个测试, 选择Template Test. 一个方框会加到手工测试图标的上,这就表明现在它是一个测试模板。
二、添加参数
你可以在一个手工测试的步骤的descrīption 或expected results中添加一个参数。
To add a parameter:
1. 在Design Steps标签中, 把焦点放在一个步骤的Descrīption 或Expected Results 中,就可以添加参数了。
2. 点击Insert Parameter 按钮。打开参数属性对话框。
3. 输入一个Parameter Name,点击OK。一个新添加的参数的语法是<<parameter name>>。
三、调用含参数的测试
当你在design steps中调用一个包含参数的手工测试时,你可以为这个参数赋值。
To call a test with parameters:
1. 在Design Steps标签中, 点击New Call to Test 按钮。打开Select a Test 对话框。
2. 默认只会显示template tests。如果你要选择的测试不是测试模板,清除Show only Template Tests。
3. 选择你要调用的带参数的手工测试。打开一个显示被调用的测试中包含的参数的对话框。
4. 在Value 列,输入每个参数的值,点击OK。
5. 在Select a Test 对话框上点击OK。这个调用作为一个链接插在design steps中,在调用的测试里会显示出这个参数所赋的值。
注意: 如果你在调用测试的时候不为参数赋值,当你把测试加入测试集或运行测试时会提示你要给参数赋值。
6. 在调用的测试中编辑参数的值,右击调用的测试选择Called test parameters。在Called Test Parameters 对话框中为参数重新赋值,点击OK。
 
[原文] <TestDirector User's Guide Version 7.6>,Page 132
Calling a Manual Test with Parameters
In your test design steps, you can include a call to a manual test. When you run the test, the test steps include the steps from the called test as part of the test. This is useful, for example, if you have template tests that you want to reuse in different tests.

In order to increase the flexibility and power of a test, you can add parameters to the test and to the tests that call it. A parameter is a variable that replaces a fixed value and can be assigned a value from outside the test in which it is defined. You can change the value of a parameter in a test according to the test that is calling it, or for different instances of a test in a test set.
 
For example, you can create a template test “Login_Template” which logs in a user with a specific password when you start your application. You need to call this test at the beginning of each test. In some cases, you will want to log in as a regular user while in others, you will need to log in as the administrator. You can therefore create two parameters, <<user name>> and <<password>>, and change the value according to the type of test that is calling “Login_Template”. If the most common login is a regular user, you can set the default values for the parameters to a regular user name and password.
This section includes the following parts:
  • Creating a Template Test
  • Adding a Parameter
  • Calling a Test with Parameters
Creating a Template Test
You can define any manual test in the test plan tree as a template test. A template test generally includes parameters and is called by different tests.

Note:Setting a test as a template test is used for filtering purposes only. You do not need to set a test as a template test in order to be able to call it or add parameters.

To create a template test:
Right-click a test in the test plan tree, and choose Template Test. A box is added around the manual test icon to indicate that it is now a template test.
 
Adding a Parameter
You can add a parameter to the descrīption or expected results of a manual test step.
To add a parameter:
1 In the Design Steps tab, place the cursor in the Descrīption box or Expected Results box of the step to which you want to add the parameter.
2 Click the Insert Parameter button. The Parameter Properties dialog box opens.
3 Type a Parameter Name, and click OK. The new parameter is added to the step using the syntax <<parameter name>>.
 
Calling a Test with Parameters
You can assign a value to a parameter when you add a call to the manual test containing the parameter in your design steps.
To call a test with parameters:
1 In the Design Steps tab, click the New Call to Test button. The Select a Test dialog box opens.
2 By default, only template tests are displayed. If you want to choose a test that is not a template test, clear Show only Template Tests.
3 To search for a specific test in the tree, type the name (or part of the name) of the test in the Find box and click the Find button. If the search is successful, TestDirector highlights the test in the tree.
4 To refresh a test in the tree, select the test and click the Refresh Selected button.
5 Select the manual test with parameters that you want to call. A dialog box opens, displaying the parameters contained in the test you are calling.
6 In the Value column, type or change the value for each parameter, and click OK.
7 Click OK in the Select a Test dialog box. The call is inserted as a link in your design steps, and the values assigned to the parameters in the called test are displayed.

Note: If you do not assign values to parameters when creating a test call, you will be prompted to do so when you create a test to call your test call, when you add your test to a test set, or when you run your test.

8 To edit the values you assigned to the parameters in the called test, right-click the test call and select Called test parameters. Type the new values you want to assign to the test parameters in the Called Test Parameters dialog box, and click OK.
9 To use two different parameter values for the same test, create two separate test calls, assigning two different values to the parameter in the called test.

[感想]
没有人想当卫道士。真的希望把原文翻译成这样的人和转贴这样文章的人多读读译文,避免误导了文章的读者。也希望聪明的读者能够利用网络搜索的便利条件多阅读原文,避免浪费时间。

TAG: 英语

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-05  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 21172
  • 日志数: 17
  • 图片数: 1
  • 建立时间: 2007-04-26
  • 更新时间: 2007-09-06

RSS订阅

Open Toolbar