更新:2007 年 11 月
取得或設定 Web 測試要求的「成功」或「失敗」結果。
命名空間: Microsoft.VisualStudio.TestTools.WebTesting
組件: Microsoft.VisualStudio.QualityTools.WebTestFramework (在 Microsoft.VisualStudio.QualityTools.WebTestFramework.dll 中)
語法
Public Property Outcome As Outcome
Dim instance As WebTestRequest
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 測試要求的結果。
備註
設定 WebTestRequest.Outcome 的主要原因是要忽略預期的失敗,因此儘管有預期的失敗,WebTestRequest 還是會標示為「成功」。
如果您的 Web 測試程式碼要設定 WebTestRequest 的結果,必須在 PostRequest 事件處理常式中進行設定,因為如果更早設定,Web 測試執行階段引擎可能會覆寫您所設定的值。
使用權限
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。