This page is maintained for older versions of Rapise only. The latest documentation can be found at: https://rapisedoc.inflectra.com
Navigator

Navigator

Top  Previous  Next

 

Navigator object. This is used to provide functions for manipulating the web browser when using the HTML libraries.

 

 

Action Summary

 

Action

Description

CheckObjectExists

Checks if object is found on the screen by its id or XPath.

Close

Closes browser.

Detach

Disconnects from a browser.

DoCheckAlert

Waits until browser alert with a given text.

DoCheckConfirmation

Waits until browser confirmation with a given text.

DoCheckPrompt

Waits until browser prompt with a given text.

DoSetExpectedConfirmResult

Set boolean value to return as a result of next browser 'confirm' request.

DoSetExpectedPromptResult

Set text to return as a result of next browser 'prompt' request.

ExecJS

Executes given JavaScript statement in a browser and returns results.

Find

Returns HTMLObject wrapping DOM element for a given 'xpath'.

GetPerformance

Reads performance information from currently used browser.

Navigate

Redirects browser to a specified URL.

Open

Opens a browser.

SelectBrowserProfile

Selects browser profile to use for testing.

 

Action Detail

 

CheckObjectExists(xpathOrObjId)

Checks if object is found on the screen by its id or XPath.

 

Parameters:

 

Name

Type

Description

xpathOrObjId

String

XPath or ID. XPath is detected by leading "." or "/".

 

Returns:

 

'true' if browser alert had occurred, 'false' otherwise.

 

Close(url)

Closes browser. Finishes session.

 

Parameters:

 

Name

Type

Description

url

String

Not used - can leave empty

 

Detach()

Disconnects from a browser. Make Navigator ready for a new browser instance connection.

 

DoCheckAlert(msg)

Waits until browser alert with a given text. Wait timeout is 10 seconds.

 

Parameters:

 

Name

Type

Description

msg

String

alert text. Can be exact text or regular expression.

 

Returns:

 

'true' if browser alert had occurred, 'false' otherwise.

 

DoCheckConfirmation(msg, result)

Waits until browser confirmation with a given text. Wait timeout is 10 seconds.

 

Parameters:

 

Name

Type

Description

msg

String

confirmation text. Can be exact text or regular expression.

result

String

Not used - can leave empty.

 

Returns:

 

'true' if browser confirmation popup is shown, 'false' otherwise.

 

DoCheckPrompt(msg, result)

Waits until browser prompt with a given text. Wait timeout is 10 seconds.

 

Parameters:

 

Name

Type

Description

msg

String

prompt text. Can be exact text or regular expression.

result

String

Not used - can leave empty.

 

Returns:

 

'true' if browser prompt popup is shown, 'false' otherwise.

 

DoSetExpectedConfirmResult(expectedRes)

Set boolean value to return as a result of next browser 'confirm' request.

 

Parameters:

 

Name

Type

Description

expectedRes

String

The text to be returned in the next request.

 

DoSetExpectedPromptResult(expectedRes)

Set text to return as a result of next browser 'prompt' request.

 

Parameters:

 

Name

Type

Description

expectedRes

String

The text to be returned in the next request.

 

ExecJS(scriptText, obj)

Executes given JavaScript statement in a browser and returns results.

 

Parameters:

 

Name

Type

Description

scriptText

String

JavaScript code.

obj

SeSObject

 

 

Returns:

 

 

 

Find(xpath, url, title, objInfo)

Returns HTMLObject wrapping DOM element for a given 'xpath'. HTMLObject is a {SeSObject} constructed by matching one of browser rules: IEHTMLObject, MozillaHTMLObject, etc.

 

Parameters:

 

Name

Type

Description

xpath

String

location path of a DOM element.

url

String

URL. If new navigator is launched, the URL is used.
Optional.

title

String

The title of the HTML document that is being searched.

objInfo

SeSObjectInfo

A populated SeSObjectInfo object.

 

Returns:

 

HTMLObject wrapping DOM element for a given 'xpath', 'null' if 'xpath' is invalid.

 

GetPerformance(resources, dontWriteReport)

Reads performance information from currently used browser. Performance numbers are based on output from window.performance structure of the web page. See also http://www.w3.org/TR/navigation-timing/#processing-model

 

Parameters:

 

Name

Type

Description

resources

Boolean

optional, bool. Set to true if you want to dump information about resource timing into the report
Optional.

dontWriteReport

Boolean

optional, Set to true if you want just return page load time and write nothing to report
Optional.

 

Returns:

 

"number" page open time (in milliseconds)

 

Navigate(url)

Redirects browser to a specified URL.

 

Parameters:

 

Name

Type

Description

url

String

The URL to navigate to.

 

Open(url)

Opens a browser. If URL is specified, goes to URL.

 

Parameters:

 

Name

Type

Description

url

String

start URL for opening browser. Can be 'null'.

 

SelectBrowserProfile(profileName)

Selects browser profile to use for testing.

 

Parameters:

 

Name

Type

Description

profileName

String

name of a browser profile.