UITestControl.SearchProperties – vlastnost
Získá slouží k identifikaci prvek kolekce dvojice hodnotu vlastnosti.
Obor názvů: Microsoft.VisualStudio.TestTools.UITesting
Sestavení: Microsoft.VisualStudio.TestTools.UITesting (v Microsoft.VisualStudio.TestTools.UITesting.dll)
Syntaxe
'Deklarace
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
Hodnota vlastnosti
Typ: Microsoft.VisualStudio.TestTools.UITesting.PropertyExpressionCollection
Kolekce dvojice hodnotu vlastnosti, které slouží k identifikaci ovládacího prvku.
Příklady
WinButton saveButton = new WinButton(window);
saveButton.SearchProperties.Add(WinProperties.Button.Name, “btnSave”);
Chcete-li použít Contains operátor
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);
Generovaný kód bude vypadat takto:
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;
}
}
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.