 | IHostCloseApplication Method (Element, Duration) |
Closes an application or web page which contains the specified element.
If the application does not react to the close request within the specified grace period,
the application process is killed.
Namespace:
Ranorex.Core
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxbool CloseApplication(
Element containedElement,
Duration gracePeriod
)
Function CloseApplication (
containedElement As Element,
gracePeriod As Duration
) As Boolean
Parameters
- containedElement
- Type: Ranorex.CoreElement
The element whose parent application to close. - gracePeriod
- Type: RanorexDuration
A grace period before the process is killed (does not apply to mobile apps).
Return Value
Type:
BooleanReturns
true if the application has closed within the grace period, otherwise
false.
Exceptions| Exception | Condition |
|---|
| ArgumentOutOfRangeException | If gracePeriod is negative. |
RemarksSetting the grace period to zero causes the application's process not to be killed.
See Also