Open topic with navigation
|Example: web_js_run and web_js_reset||Miscellaneous Functions|
web_js_reset discards saved variables and objects and recovers the memory.
When the code called in a web_js_run step returns, the context is not discarded. Therefore, functions, objects, and variables remain in context and can be used in subsequent steps of web_js_run.
For example, if a function is defined in one web_js_run step, it can be used in a subsequent step without redefining it. In addition, if the function in a web_js_run step defines, calculates, or fetches some data, that data can be used again in a subsequent web_js_run step.
If the run-time setting
Simulate a new user on each iteration is set, web_js_reset is called automatically at the start of each iteration. If
Simulate a new user on each iteration is not set, avoid excessive memory consumption by inserting web_js_reset calls in your script at points where you no longer need the saved context.
This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.
You cannot use standard parameterization for any arguments in this function.