Retrieve text string from the control

Namespace:  QAliber.Engine.Controls.UIA
Assembly:  QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public string Text { get; }
Visual Basic (Declaration)
Public ReadOnly Property Text As String
Visual C++
public:
virtual property String^ Text {
	String^ get () sealed;
}

Return Value

string text or empty sting if no text on the control

Examples

This code uses windows address book application.
CopyC#
 Log.Default.Filename = @"C:\testLog.txt";
 System.Diagnostics.Process.Start("wab");
 System.Threading.Thread.Sleep(2000);

  //if not default, dialog appears, handle it
  UIAWindow defaultDialog = Desktop.UIA.WaitForControl(@"Address Book",3000) as UIAWindow;
  UIAButton noButton =null;
  if (defaultDialog != null)
  {
      noButton = defaultDialog[@"No", @"Button", @"2"] as UIAButton;
      noButton.Click();
 }

 //read write clear the search name edit box
UIAWindow wabWin = Desktop.UIA[@"Address Book - Main Identity", @"WABBrowseView", @"UIAWindow"] as UIAWindow;
UIAEditBox nameEB = wabWin[@"Type name or select from list:", @"Edit", @"9004"] as UIAEditBox;
MessageBox.Show("Before Text: " + nameEB.Text);
nameEB.Write("Barak Obama");
MessageBox.Show("After Text: " + nameEB.Text);
nameEB.Clear();
MessageBox.Show("After Clear: " + nameEB.Text);

See Also