Release cached properties associated with the control.
Cachable properties are :
Children
Parent
CodePath
ID
Namespace:
QAliber.Engine.ControlsAssembly: QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public virtual void Refresh() |
| Visual Basic (Declaration) |
|---|
Public Overridable Sub Refresh |
| Visual C++ |
|---|
public: virtual void Refresh() |
Remarks
If the control is changed during automation it is recommended to refresh the control (or its parent), before using it
Examples
Try run this code without the Refresh(). See the children is not updated till the refresh is called.
CopyC#
int openApps = Desktop.UIA.Children.Length; Console.Writeline("Number of open applications before are : " + openApps); System.Diagnostics.Process.Start("notepad"); System.Threading.Thread.Sleep(2000); Desktop.UIA.Refresh(); openApps = Desktop.UIA.Children.Length; Console.Writeline("Number of open applications after are : " + openApps);