Skip to content

Dynamic Filters

Before reading this you might want to see:

Main Article

 
The concept of Dynamic Filters is to provide you the ability to filter your data based on the value fetched from the application during the runtime. In the Data Filters, the value on which that data has to be filtered should be provided.
There could be scenario(s), where you are not aware of the value that the application would fetch (dynamic content) based on which the filter on the Data File should be applied. Here the concept of Dynamic Data Filters would be of great help.
 
A Dynamic Filter is a special case of Data Filters in Worksoft SaaS where the Filtering of the dataset occurs when the execution is in progress (i.e runtime). To know how to create a Data Filter, please click here.
The value based on which the dataset has to be filtered needs to be provided as a variable into the Data Filter. Based on the value fetched runtime, the target Data File (Dataset) is filtered and the execution occurs for the filtered dataset. 
 
NOTE: Please note that the value based on which the filter is to be applied needs to be initialized in the Test Script before the beginning of the workflow loop. We recommend creating a separate initialize Test Script which stores the values that are generated during runtime.
 
Steps to create a Dynamic Filter
To implement this using Dynamic Filters in Worksoft SaaS, please follow the steps illustrated below.Consider the AUT, Health Insurance Cost Calculator. Refer to the Data-Driven TestCase scope to know more.
  • Create the Initialize variables Test Script. This is done to configure the value using which a filter will be applied. There are two ways of doing this,
    • You can fetch the value from the application's UI and use it as a filter.
    • You can hardcode the required value into a variable and use it as required.

  • Upload the Data Definition and the corresponding Data File if you have not done already, click here to know more about creating a Data Definition and Data File.
  • Navigate to Create Data Filter from Data Definition screen and,
  • Select Attribute: Age
  • Operator: '='
  • Value: ${Age} 

  • Assemble Scripts into Scenario, further to a Run Definition and validate.
  • In the Bind Data Screen, apply the Data Filter that was initially created.

  • The variable that you configured as filtering value can also be used in the Test Scripts as a value by calling the variable in the required instruction.
  • Provide the Testing Contexts and Execute.

After reading this you might want to see:

 
 

Feedback and Knowledge Base