Skip to content
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.Flowcharts is retired. Current docs
Get Free Trial
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.

Override Behaviour

Automation may need to support variations in implementation based on various factors.

Use cases:

  1. 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.
  2. The Application Under Test (AUT) can have different flavours of the same application. For example, country specific slight changes.
  3. Application behaves differently based on configuration

For the above, use branching flows with Constant Attribute conditions.
Eg. Branch the flow based on conditions like $user._isPaid? or $salesforce._isClassic? or $application._isEuropean

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.

For the above, add a Data Generator override.

  1. Make sure that you have at least one Condition Node with $user._isAdult in it. Eg. $user._isAdult?.

  2. Go to Entities tab, choose the relevant Entity ($user) and Attribute (age). Go to Data Generator tab. It may look like this:

    Default data generator for user age

  3. On the top right, there is a drop-down with text For Default {}. Click on it and click on the Create New option.

  4. In the section Matching Path Conditions the condition $user._isAdult? will appear. Check the checkbox next to it. Choose value true.

    Entity filter for adult

  5. Click Create. All the data generator fields will still appear, but disabled

  6. Check the Override for immutable combo checkbox. The fields become editable.

  7. Set the Data Generator Type to Number and set the min-value to 18

    Data generator for adult

  8. Save the Entity

  9. Create another immutable combo with condition $user._isAdult? and value false. In this set the max-value to 17.

    Entity filter for adult

    Data generator for adult=false

Now whenever a path needs an _isAdult=true user, the age will be set to greater than or equal to 18. For _isAdult=false, it will be set to less than 18.

For an adult user, the valid lower boundary value would be 18. For non-adult higher boundary would be 17.

  1. Create Entity Filters as mentioned in the Data Generator Override section.

  2. Go to Positive Validations tab

  3. Default may look like this

    Positive Validations for default user

  4. Override for Adult

    Positive Validations for adult user

  5. Override for Adult false

    Positive Validations for non-adult user

For an adult user, 17 should be an invalid value. For non-adult 18 should be an invalid value.

  1. Create Entity Filters as mentioned in the Data Generator Override section.

  2. Go to Negative Validations tab

  3. Default may look like this

    Negative Validations for default user

  4. Override for Adult

    Negative Validations for adult user

  5. Override for Adult false

    Negative Validations for non-adult user

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.

For the above, add a UI Element override.

  1. Go to Entities tab, choose the relevant Entity ($coupon) and Attribute (discount). Go to UI Element tab.

  2. On the top right, there is a drop-down with text For Default {}. Click on it and click on the Create New option.

  3. In the section Matching Custom Conditions add Name: _isNewUI and Value: true
    In this, _isNewUI is the custom condition and true is the value of that custom condition. Refer here to learn about how to pass custom condition/variable during run.

    Entity filter with Custom Conditions

  4. Click Create. All the existing UI Elements will still appear, but disabled

  5. 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.

  6. Change the UI Elements as they appear for new UI

    UI Element Override

  7. Save the Entity

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.

For the above, add a Screen override.

  1. Go to Screen tab, choose the relevant Screen. The following is an example of the default screen UI Elements:

    Default screen @base

  2. On the top right, there is a drop-down with text For Default {}. Click on it and click on the Create New option.

  3. In the section Matching Custom Conditions add Name: _isNewUI and Value: true
    In this, _isNewUI is the custom condition and true is the value of that custom condition. Refer here to learn about how to pass custom condition/variable during run.

    Create new Screen Filter

  4. Click Create. All the existing UI Elements will still appear, but disabled.

  5. Click on the Override Accessor checkbox to the right of the UI Element we want to override.
    The UI Element become editable.

  6. Change the UI Elements as they appear for new UI.

    Screen filter for _isNewUI

  7. Save the Screen

Use cases:

  • Application is evolving from an older UI to a newer UI. Actions to be performed on both these user interfaces are similar except they could differ for specific steps. Also, an entire keyword may need to be overridden for the new UI.
  • Application has iOS and Android apps. Actions to be performed on both these apps are similar except they could differ for specific steps. Also, an entire keyword may need to be overridden for one of these apps.

For the above cases, add a Keyword/Step override.

  1. To override specific step(s), go to Keywords tab. Select the Keyword containing the step(s). The following is an example of the default Keyword steps:

    Default keyword Steps

  2. On the top right, there is a drop-down with text For Default {}. Click on it and click on the Create New option.

  3. In the section Matching Custom Conditions add Name: _isNewUI and Value: true
    In this, _isNewUI is the custom condition and true is the value of that custom condition. Refer here to learn about how to pass custom condition/variable during run.

    Create new Keyword Filter

  4. Click Create. All the existing steps will still appear, but disabled.

  5. To override a step, check the Override Step checkbox at the right. This makes the step editable.

  6. Override all such steps as required for this Filter _isNewUI.

    Keyword Filter for _isNewUI

  7. Save the Keyword.

  1. We can select the keyword to be overridden as a whole, i.e; all the steps can be redefined.

  2. Select the Filter and check the Override Keyword checkbox to the right of the filter drop-down.

    keyword filter

  3. At this stage, all the default steps are shown as commented. We can add/delete steps as per the requirement. Operations performed on steps when Keyword Override is selected will not impact the steps in default filter.

  4. Save the Keyword.

To pass external conditions or variables to a flow, you can follow these steps:

  1. Click on the Run button to open the Run Settings dialog. Click on Advanced Run Settings.

  2. In the External Variables textbox, add your conditions/variables in the form of key-value pairs.
    Each line should contain only one key-value pair in the format key=value.

    External Variables

  3. Click Run. Now, the new UI Element will be used during execution.