UITestControl.SearchProperties 屬性
取得用於識別控制項的屬性值組集合。
命名空間: Microsoft.VisualStudio.TestTools.UITesting
組件: Microsoft.VisualStudio.TestTools.UITesting (在 Microsoft.VisualStudio.TestTools.UITesting.dll 中)
語法
'宣告
Public ReadOnly Property SearchProperties As PropertyExpressionCollection
public PropertyExpressionCollection SearchProperties { get; }
public:
property PropertyExpressionCollection^ SearchProperties {
PropertyExpressionCollection^ get ();
}
member SearchProperties : PropertyExpressionCollection with get
function get SearchProperties () : PropertyExpressionCollection
屬性值
型別:Microsoft.VisualStudio.TestTools.UITesting.PropertyExpressionCollection
用於識別控制項的屬性值組集合。
範例
WinButton saveButton = new WinButton(window);
saveButton.SearchProperties.Add(WinProperties.Button.Name, “btnSave”);
如果您要使用Contains運算子
WinButton saveButton = new WinButton(window);
//If the name of the button contains “Save”, then it will be found.
saveButton.SearchProperties.Add(WinProperties.Button.Name, “Save”, PropertyExpressionOperator. Contains);
產生的程式碼看起來如下:
Public WinButton BtnSaveButton
{
get
{
if ((this.mBtnSaveButton == null))
{
this.mBtnSaveButton = new WinButton(this);
#region Search Criteria
this.mBtnSaveButton.SearchProperties[WinProperties.Button.Name] = "btnSave";
#endregion
}
return this.mBtnSaveButton;
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。