The getPageVariable() method searches and returns a page variable from a specified page.

Syntax

bapi.helper.getPageVariable(page, variableName, currentPage)

Parameters

page

The specified page to searching through.

This is a parameter of type pageElementRequest.

variableName

String: the wanted page variable name.

currentPage

The browser page object where the request is being ran.

Return Value

The page variable from the specified page or null if not found.

Example

// setting & checking value in the current page:
bapi.helper.setPageVariable(CURRENT_BROWSER_FORM, "foo", "bar")

// get the value for key "foo" from the current page:
bapi.helper.getPageVariable(CURRENT_BROWSER_FORM, "foo");

Result

"bar"

Example

// setting & checking value in the root page:
bapi.helper.setPageVariable("root", "foo2", "variable value");

// get the value for key "foo2" from the root page:
bapi.helper.getPageVariable("root", "foo2");

Result

"variable value"