WebTest.Outcome 属性

更新:2007 年 11 月

获取或设置 Web 测试的“通过”或“未通过”结果。

命名空间:  Microsoft.VisualStudio.TestTools.WebTesting
程序集:  Microsoft.VisualStudio.QualityTools.WebTestFramework(在 Microsoft.VisualStudio.QualityTools.WebTestFramework.dll 中)

语法

声明
Public Property Outcome As Outcome
用法
Dim instance As WebTest
Dim value As Outcome

value = instance.Outcome

instance.Outcome = value
public Outcome Outcome { get; set; }
public:
property Outcome Outcome {
    Outcome get ();
    void set (Outcome value);
}
public function get Outcome () : Outcome
public function set Outcome (value : Outcome)

属性值

类型:Microsoft.VisualStudio.TestTools.WebTesting.Outcome

Web 测试的结果。

备注

设置 WebTest.Outcome 的主要原因是要忽略预期失败,以使得 WebTest 不受预期失败的影响,仍标记为“通过”。

由于 Web 测试运行时引擎也设置 WebTest 的 Outcome 属性,因此 Outcome 属性的最终值可能与您的代码设置的值不同。

如果将 WebTest.Outcome 的值设置为“未通过”,则 Web 测试运行时引擎将不会重写此设置,且此 Web 测试完成后将标记为“未通过”。但是,如果在 Web 测试中期(发出所有 Web 测试请求及调用验证规则之前)将 WebTest.Outcome 设置为“通过”,则如果在您将该值设置为“通过”之后发生错误,Web 测试运行时引擎将重写该值并将 WebTest.Outcome 设置为“未通过”。

若要保证 WebTest.Outcome 的最终值为“通过”,请在 PostWebTest 事件处理程序中设置它。

权限

另请参见

参考

WebTest 类

WebTest 成员

Microsoft.VisualStudio.TestTools.WebTesting 命名空间