Table of Contents

Class PopupWatcher

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Allows watching for unexpected dialogs and popups in the background.
Use Watch(RepoItemInfo, PopupItemCallback) or WatchAndClick(RepoItemInfo, RepoItemInfo) to register for notifications by providing a repository item or RxPath to watch for, as well as a callback to get notified or another repository item to click on if the watched element is found.

public sealed class PopupWatcher : IDisposable
Inheritance
PopupWatcher
Implements
Inherited Members

Constructors

PopupWatcher()

Initializes a new instance of the PopupWatcher class.

public PopupWatcher()

Properties

EnableReportMessages

Gets or sets a value indicating whether to report message when watched items are found and/or clicked.

public bool EnableReportMessages { get; set; }

Property Value

bool

true if report messages should be enabled; otherwise, false.

ReportCategory

Gets or sets the report category used by the watcher to report messages.

public string ReportCategory { get; set; }

Property Value

string

The report category. Defaults to 'Popup Watcher'.

RestoreActiveWindow

Gets or sets a value indicating whether the active window should be restored after performing the callback/click action.

public bool RestoreActiveWindow { get; set; }

Property Value

bool

true if the previously active window should be restored; otherwise, false.

UpdateInterval

Gets or sets the update interval used to search for popup windows in the background.

public Duration UpdateInterval { get; set; }

Property Value

Duration

The update interval. Defaults to 100ms.

Methods

Clear()

Clears all watched repository items and paths.

public void Clear()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Start()

Starts watching for configured repository items and RxPaths in the background.

public void Start()

Stop()

Stops watching for repository items and RxPaths.

public void Stop()

Watch(RepoGenBaseFolder, PopupItemCallback)

Watches the specified repository item and invokes the specified callback when the repository item is found.

public void Watch(RepoGenBaseFolder watchedItem, PopupItemCallback callback)

Parameters

watchedItem RepoGenBaseFolder

The repository item/folder to watch.

callback PopupItemCallback

The notification callback.

Remarks

After adding watched items, Start() needs to be called to start the watcher.

Watch(RepoItemInfo, PopupItemCallback)

Watches the specified repository item and invokes the specified callback when the repository item is found.

public void Watch(RepoItemInfo watchedItem, PopupItemCallback callback)

Parameters

watchedItem RepoItemInfo

The repository item/folder to watch.

callback PopupItemCallback

The notification callback.

Remarks

After adding watched items, Start() needs to be called to start the watcher.

Watch(RxPath, PopupPathCallback)

Watches the specified repository item and invokes the specified callback when the repository item is found.

public void Watch(RxPath path, PopupPathCallback callback)

Parameters

path RxPath

The repository item/folder to watch.

callback PopupPathCallback

The notification callback.

Remarks

After adding watched items, Start() needs to be called to start the watcher.

WatchAndClick(RepoGenBaseFolder, RepoItemInfo)

Watches the repository item specified by watchedItem and clicks on the item specified by clickedItem when the watched item is found.

public void WatchAndClick(RepoGenBaseFolder watchedItem, RepoItemInfo clickedItem)

Parameters

watchedItem RepoGenBaseFolder

The repository item/folder to watch.

clickedItem RepoItemInfo

The repository item to click on when the specified watched item is found.

Remarks

After adding watched items, Start() needs to be called to start the watcher.

WatchAndClick(RepoItemInfo, RepoItemInfo)

Watches the repository item specified by watchedItem and clicks on the item specified by clickedItem when the watched item is found.

public void WatchAndClick(RepoItemInfo watchedItem, RepoItemInfo clickedItem)

Parameters

watchedItem RepoItemInfo

The repository item/folder to watch.

clickedItem RepoItemInfo

The repository item to click on when the specified watched item is found.

Remarks

After adding watched items, Start() needs to be called to start the watcher.