How to extract and manipulate the data contained in an object verification window (java script editor)?

  • KM1110051
  • 17-Mar-2011
  • 29-Apr-2012

Summary

Accessing to the LR API. It is available from the JavaScript ID Method by qualifying the API with “ArgsContext”

Question

How to extract and manipulate the data contained in an object verification window (java script editor) in Ajax TruClient protocol?

Answer

Accessing to the LR API. It is available from the JavaScript ID Method by qualifying the API with “ArgsContext”

Important Points:JavaScript code running in “Evaluate JavaScript” steps (or any other step) is executed in a context called “ArgsContext”.

  • JavaScript code running in “Evaluate JavaScript” steps (or any other step) is executed in a context called “ArgsContext”.
  • JavaScript code running in “JavaScript ID Method” is executed in a separate context (upon each call, a new context is created).
  • When you are using an “Evaluate JavaScript” step, your code is already executed inside the ArgsContext, so there is no need to qualify it by adding the prefix “ArgsContext”.
  • You only need to use the “ArgsContext” prefix if you are using the “JavaScript ID Method” and you wish to access something that is defined in the ArgsContext (e.g. the LR API).
  • For example, in “Evaluate JavaScript” step you can write LR.log(“TEST”), but in the “JavaScript ID Method” you need to write ArgsContext.LR.log(“TEST”).