Поделиться через


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

См. также

Ссылки

UITestControl Класс

Microsoft.VisualStudio.TestTools.UITesting - пространство имен