Override Behaviour
abstract
Automation may need to support variations in implementation based on various factors.
Branch based Behaviour Override
Use cases:- The flow may be different for different types of entities. For example a Free User vs a Paid User may have different flows for accessing some resources.
- The Application Under Test (AUT) can have different flavours of the same application. For example, country specific slight changes.
- Application behaves differently based on configuration
Eg. Branch the flow based on conditions like
$user._isPaid?
or $salesforce._isClassic?
or $application._isEuropean
Data Generator Override
Use cases:- Different data may need to be input based on some entity attribute. For example, an adult user's age has to be above 18 years to access specific content.
- Make sure that you have at least one Condition Node with
$user._isAdult
in it. Eg.$user._isAdult?
. - Go to Entities tab, choose the relevant Entity (
$user
) and Attribute (age
). Go toData Generator
tab. It may look like this: - On the top right, there is a drop down with text
For Default{}
- Click on it and click on
Create New
- In the section
Matching Path Conditions
the condition$user._isAdult?
will appear. Check the checkbox next to it. Choose valuetrue
. - Click
Create
. All the data generator fields will still appear, but disabled - Check the
Override for immutable combo
checkbox. The fields become editable. - Set the
Data Generator Type
toNumber
and set themin
to18
- Save the Entity
- Create another immutable combo with condition
$user._isAdult?
and valuefalse
. In this set themax
to 17.
Valid Values Override
For an adult user, the valid lower boundary value would be 18. For non-adult higher boundary would be 17.- Create Entity Filters as mentioned in the Data Generator Override section.
- Go to Positive Validations tab
- Default may look like this
- Override for Adult
- Override for Adult false
Invalid Values Override
For an adult user, 17 should be an invalid value. For non-adult 18 should be an invalid value.- Create Entity Filters as mentioned in the Data Generator Override section.
- Go to Negative Validations tab
- Default may look like this
- Override for Adult
- Override for Adult false
UI Element Override
Use cases:- Application is evolving from an older UI to a newer UI and the UI Elements have changed.
- Application has iOS and Android apps and they differ slightly in the way objects are identified.
- Go to Entities tab, choose the relevant Entity ($coupon) and Attribute (discount). Go to UI Element tab.
- On the top right, there is a drop down with text
For Default{}
- Click on it and click on
Create New
- In the section
Matching Custom Conditions
add Name:_isNewUI
and Value:true
In this,_isNewUI
is the custom condition andtrue
is the value of that custom condition. - Click
Create
. All the existing UI Elements will still appear, but disabled - Click on the Override Accessor checkbox to the right of the UI Element we want to override.
The UI Element and UI Error Element become editable. - Change the UI Elements as they appear for new UI
- Save the Entity
Pass the condition/variable during Run
To pass external conditions or variables to a flow, you can follow these steps:- Click on the
Run
button to open theRun Settings
dialog. Click onAdvanced Run Settings
. - In the
External Variables
textbox, add your conditions/variables in the form ofkey-value
pairs.
Each line should contain only one key-value pair in the formatkey=value
. - Click
Run
. Now, the new UI Element will be used during execution.