The getPageVariable()
method searches and returns a page variable from a specified page.
bapi.helper.getPageVariable(page, variableName, currentPage)
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.
The page variable from the specified page or null if not found.
// 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"
// 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"