Store Value Across Sessions
Rapise includes API simplifying reading and storing of values between sessions:
Global.GetProperty('Propname', defValue)
-- Read property value from %WORKDIR%\Config.json
. See online help.
Global.SetProperty('PropName', value)
-- Set property value to %WORKDIR%\Config.json
. If the file does not exist it will be created. See online help.
Incrementing
Here is a sample function. Every time it is called the value is incremented by 1 and new value is returned as a string INV-nnn
, where nnn
is a new number.
function GlobalIncrementInvoiceNo()
{
var invoiceNo = Global.GetProperty('InvoiceNo', 100)
invoiceNo++;
Global.SetProperty('InvoiceNo', invoiceNo)
return 'INV-'+invoiceNo;
}
You may put this function into Functions (<testname>.user.js
) file.
Calling from RVL
Once function is defined in the .user.js
it may be called from RVL using the Functions
object (all global functions are shown as methods for this object).

Working Example
You may download and this sample test.