Skip to content

System Defined Variables

System Defined Variables:

“System Defined Variables” in Worksoft SaaS is designed to cater the need for reuse of a single Test Case which differs in behaviour and layout. Worksoft SaaS provides you to handle such behaviour based on Testing Contexts (like different devices, browsers, browser versions, etc.), Environments and Automation Assets (Data Files, Scenarios & Run Definitions).

Example:

Consider a scenario where you have to verify the product details on mobile devices and desktop. Assign the System Defined Variables in the script that will have to execute on mobile devices and desktop. The execution condition would be based on the Testing Context selected during the Test Run.

Steps To Configure System Variables:

  • Edit the test script for which System Variables are to be configured.
  • Click on the "Add Instruction" icon, to add conditional command.
  • In “Command” drop-down, select “IF” command and at the target, select “Add new locator”.
  • Right-click in the Target field as shown, then mouse hover on the “System Defined Variables” and the associated labels get populated as shown below.
  • Select the condition which needs to be compared first. Here it would be the 3rd level mouseOver that would be selected first.

  • Select the values that need to be compared from the populated results.
  • Type the condition/operator (“==” or “!=”) beside the label in the text box.
  • Right-click on the same text box and select the result type that needs to be compared with the condition provided in the previous step from the populated results.
  • Click on save.
  • System Variable representation is shown below:


  • Add the commands which are to be executed in IF and ELSE block as per requirement.
  • Execute the Test Run. 
  • Below is the execution screen, showing the result of IF condition.


 

Feedback and Knowledge Base