Waits for a specific property

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

Syntax

C#
public virtual bool WaitForProperty(
	string propertyName,
	Object val,
	int timeout
)
Visual Basic (Declaration)
Public Overridable Function WaitForProperty ( _
	propertyName As String, _
	val As Object, _
	timeout As Integer _
) As Boolean
Visual C++
public:
virtual bool WaitForProperty(
	String^ propertyName, 
	Object^ val, 
	int timeout
)

Parameters

propertyName
Type: System..::.String
The property to look for
val
Type: System..::.Object
The value of the property
timeout
Type: System..::.Int32
The time (in miliseconds) to wait for the property to be equal to the value

Return Value

True if the property is equal to val within timeout, else false

Remarks

Pay attention that the type of the val matches the type of the property

Examples

CopyC#
System.Diagnostics.Process.Start("calc");
  //Wait for calc app to appear
  UIAWindow calcMainWin = Desktop.UIA.WaitForControl(@"Calculator",2000) as UIAWindow;
  //Minimizes calc if it is visible 
  if (calcMainWin.WaitProperty("Visible", true, 10000))
       calcMainWin.Minimize();

See Also