Interface IHost
Represents a machine/device that provides UI elements that can be automated by Ranorex.
public interface IHost : IAdapter
- Inherited Members
Methods
CloseApplication(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.
bool CloseApplication(Element containedElement, Duration gracePeriod)
Parameters
containedElementElementThe element whose parent application to close.
gracePeriodDurationA grace period before the process is killed (does not apply to mobile apps).
Returns
- bool
Returns
trueif the application has closed within the grace period, otherwisefalse.
Remarks
Setting the grace period to zero causes the application's process not to be killed.
Exceptions
- ArgumentOutOfRangeException
If
gracePeriodis negative.
CloseApplication(int)
Closes an application with the specified process ID by trying to close its main window.
void CloseApplication(int processId)
Parameters
processIdintThe process ID of the application to close.
Exceptions
- ElementNotFoundException
If no application is found.
CloseApplication(int, Duration)
Closes an application with the specified process ID by trying to close its main window.
bool CloseApplication(int processId, Duration gracePeriod)
Parameters
processIdintThe process ID of the application to close.
gracePeriodDurationA grace period before the process is killed (does not apply to mobile apps).
Returns
- bool
Returns
trueif the application has closed within the grace period, otherwisefalse.
Remarks
Setting the grace period to zero causes the application's process not to be killed.
Exceptions
- ArgumentOutOfRangeException
If
gracePeriodis negative.
GetDevToolsSession()
Get the devtools session.
IDevToolsSession GetDevToolsSession()
Returns
KillApplication(Element)
Kills the process which contains the specified element.
void KillApplication(Element containedElement)
Parameters
containedElementElementThe element whose parent application to kill.
OpenBrowser(string, string)
Opens a web page in the specified browser.
int OpenBrowser(string url, string browserName)
Parameters
urlstringThe URL of the web page to open.
browserNamestringThe name of the browser to open. Can either be "firefox", "ie", "chrome", "chromium" or "edge".
Returns
- int
The process ID of the browser.
OpenBrowser(string, string, string, bool, bool, bool, bool, bool, bool)
Opens a web page in the specified browser.
int OpenBrowser(string url, string browserName, string browserArgs, bool killExisting, bool maximized, bool clearCache, bool incognitoMode, bool clearCookies, bool instrument)
Parameters
urlstringThe URL of the web page to open.
browserNamestringThe name of the browser to open. Can either be "firefox", "ie", "chrome", "chromium" or "edge".
browserArgsstringAdditional command line arguments to pass to the browser.
killExistingboolSpecifies whether any running browser instances should be closed first.
maximizedboolSpecifies whether the started browser instances should be started maximized.
clearCacheboolSpecifies whether cache should be cleared on browser start.
incognitoModeboolSpecifies whether the browser should start in incognito mode
clearCookiesboolSpecifies whether cookies should be deleted on browser start.
instrumentboolSpecifies whether the browser should be instrumented before browser start.
Returns
- int
The process ID of the browser.
OpenBrowser(string, string, string, bool, bool, bool, bool, bool, bool, bool, bool)
Opens a web page in the specified browser.
int OpenBrowser(string url, string browserName, string browserArgs, bool killExisting, bool maximized, bool clearCache, bool clearCodeCache, bool clearServiceWorker, bool incognitoMode, bool clearCookies, bool instrument)
Parameters
urlstringThe URL of the web page to open.
browserNamestringThe name of the browser to open. Can either be "firefox", "ie", "chrome", "chromium" or "edge".
browserArgsstringAdditional command line arguments to pass to the browser.
killExistingboolSpecifies whether any running browser instances should be closed first.
maximizedboolSpecifies whether the started browser instances should be started maximized.
clearCacheboolSpecifies whether cache should be cleared on browser start.
clearCodeCacheboolSpecifies whether code cache should be cleared on browser start.
clearServiceWorkerboolSpecifies whether Service Worker folder should be cleared on browser start.
incognitoModeboolSpecifies whether the browser should start in incognito mode
clearCookiesboolSpecifies whether cookies should be deleted on browser start.
instrumentboolSpecifies whether the browser should be instrumented before browser start.
Returns
- int
The process ID of the browser.