Skip to main content

Branch

The Branch command executes a group of commands if a specified condition is meet.

Example

Below screenshot shows the simplest example where the Branch command can be used.

BranchExample.png

The If...ElseIf..Else container command provides standard conditional branch functionality. If the condition is true the sub-commands are executed. Otherwise, the sub-commands are skipped.

The Branch Type can be If, ElseIf or Else. An ElseIf branch command must come after an If branch, and an Else branch command must come after an If or ElseIf branch command. If, ElseIf and Else branch commands must have the same parent command in order to work together.

Image_6.png

Agent with If..ElseIf..Else branch commands.

Command Properties

Branch

Branch type: The type of branch. The Branch Type can be If, Else If or Else. An Else If branch command must come after an If branch, and an Else branch command must come after an If or Else If branch command. If, Else If and Else branch commands must have the same parent command in order to work together.

Condition: The branch  condition . Value  in the Condition Text area comes from  ‘Condition Type’.

  • Compare to Value: A constant value compared to the input value or selected web content. When comparing input data, the constant value will be converted from a string into the same type as the input data. The operation fails if the conversion fails.

  • Condition Type: The types of condition to check .

    • Compare Data Value: Compares a specified input value with a specified constant.

    • Compare Web Selection: Compares the content of a selected web element  with a specified constant.

    • Compare Last Status Code: Compares the  status code.

    • Condition Script: A script is used to decide if the condition is True  or False.

    • Always True: The Condition is always True.

    • Always False: The Condition is always False.

  • Data Consumer: Specifies the input data to use when processing this command.

    • Captured Data Command: Specifies the previously captured data column name which you want to use as  input data .

    • Data Source:  The source of the data consumed.

    • Data Transformation Script: Data transformation script. Default value is set to Disabled which is reflected by "Enabled" property value False. If you want to enable the data transformation script then you need to set to "Enabled" property value as True.

    • Input Parameter Name : Specifies the input parameter name to use .

    • Provider Column Name: Specifies a column from the data source that should provide the data to this command. specifies a command that provides data to the agent. A command can provide data to itself.

    • Provider Container: Specifies a command that provides data to this command.

  • Data Type: The data type of specified value.

  • HTML  Attributes: Specifies the input data to use when processing this command.

  • Operator: The Operator to use when comparing two values. Some of the operators are unary operators which don’t use the Compare To value. We  use operators such as Exists, Does Not Exists, IsEmpty, IsNotEmpty, Equals, Does Not Equal, Is  Greater Than, Is Greater Than or Equal, Is Less Than , Is Less Than or Equal, Contains, Does Not Contain, Starts With, Ends With, Matches, Does Not Match etc.

  • Script: A script used to define the condition check.

    • C# Script: Specifies C# script.

    • Enabled: To use the Script we need to set this Property as True. The default value is set to False, which indicates that the script is disabled.

    • Library Assembly File: The name of a custom assembly file when "Use Default Library" is set to false.

    • Library Method Name: The method to execute when using the default script library.

    • Library Method Parameter: A custom parameter passed to the script library method.

    • Python Script: Specifies Python script.

    • Regex Script: Specifies Regex script.

    • Script Language: Specifies the scripting language which you want to use e.g C#, VB.NET, Python, Script Library, Regular Expressions.

    • Template Name: The template name of the referenced template.

    • Template Reference: Loads this script from a template when the agent is loaded.

    • Use Default Library: Uses the default script library when Script Language is set to Script Library.

    • Use Selection: The script is provided with the selected web element. The script will not be provided with the selected web element if this value is False.

    • Use Shared Library: Uses a script library that is shared among all agents.

    • VB.NET Script: Specifies VB.NET script.

  • Selection: The selection XPaths of the web elements associated with this command.

    • Paths:  List of selection XPaths.

      • Path:  The selection XPath.

Command

Command Description: A custom description for the command. Default value is Empty.

Command Transformation Script:  A script used to change command properties at run time. The default value is disabled.

Disabled: This property set to True allows user to disable the command. A disabled command will be ignored. The default value is set to False.

ID:  This property indicates the internal unique ID of the command and is always auto- generated e.g. 58c8e4ac-e4c0-48f7-a63d-77064945380b.

Increase Data Count: This property indicates the data count every time this command is processed. The default value is set to False. Set it to TRUE if you want to get the count of the number of times a specific command is executed to get the data. The data count value is increased during data extraction, so it is used to measure agent progress and basis this increased data count, the agent  decides the success criteria.

Name:  This property specifies the name of the command.

Notify On Critical Error:  A notification email is sent at the end of an agent run if the command encounters a critical error, and the agent has been configured to notify on critical errors. Critical errors include page load errors and missing required web selections. Default value is set to False.

Container

Always Execute:  Set this property value as True, if you want  the container is always executed if encountered on retry or continue. List Commands are only executed if they processes a single input. Always Execute can be used to always execute container commands when retrying, even when they have already been completed. Default Value is set to False.

Command Link:  Links to another container command where processing will continue. The targeted container command will be executed, so it’s normally best to link to a group command  that does nothing, so it’s clear what happens after the link.

Dependent Command:  The action of the dependent command will come into effect only when the agent has a supporting parent container command, in which case, it will be executed before the parent container command is processed.

Debug

Debug BreakPoint: Debugging will break at this command if the break point is set. Default value is set to False.

Debug Disabled: A disabled command will be ignored during debugging. Default value is set to False.

Debug Error Option: This property specifies what action to take when an error occurs in the debugger. Default value is set to Notify which indicates that when an error occurs at debugging time , then it will be notified. If we want to ignore the error at debug time , then we need to set this property value as Ignore.

Export

Data Validation Script: A script is used to validate a single row of export data.

Duplicate Export Row Handling: This property specifies what action to take when duplicate data export rows are detected. All  child data of a removed row will be assigned to the existing duplicate row. The duplicate check can be performed on values extracted by  Capture commands with the key property, or it can be performed on hash keys calculated from all values in an export data row. Default value is set to “None” .

  • None: This will not remove Duplicate rows.

  • Remove(SHA-512):  This is used to  remove Duplicate rows when an agent run in single session.

  • Remove(Key Values): This is used to  remove Duplicate rows when an agent run in single session.

  • Remove(Key Values Across Sessions) :  This is used to  remove Duplicate rows when an agent run in Performance Sessions.

Empty Export Row Handling: This property specifies what action to take when an export data  row is empty. If removing empty rows, all child data of an empty row will also be removed, even if the child data is not empty. Capture commands with the property “Act as System” are ignored when checking if a data row is empty. Default value is set to “None” .

  • None: This will not remove Empty rows.

  • Remove Row: Removes Empty rows.

  • Remove Row and Increase Error: Remove Empty rows and increase errors.

  • Trigger Export Failure: Export fails.

Empty Export Table Handling: This property specifies what action to take when an export data table is empty. Default value is set to “None”.

  • None: This will not remove Empty table.

  • Remove: Removes Empty table.

  • Remove Table and Trigger Error: Remove Empty table and trigger error message.

  • Trigger Export Failure: Export fails.

Export Empty Row If No Data: Default value is set to True indicates that exports a single empty data row if this container extracts no data. Parent and Sibling data will be lost if merged with an empty data set, so this option ensures that parent and sibling data is exported when this container extracts no data. This option only has an effect when “Export Method” is set to “Add Columns and Rows”. If we don’t want to export a single empty data row if the container extracts no data , then we need to set is False.

Export Enabled: Default value is set to True. A command with Export Enabled set to False will not save any data to data output. This includes all sub-commands if the command is a container command.

Export ID Name: This property specifies the name of the primary key column in the exported table (database table, spreadsheet, CSV file, XML Node), if this container generates a new table. The export name postfixed with “ID” is used if this property is empty. If multiple agents are exporting data to the same table,  then you must set this option to the same value for all those agents.

Export ID Sort Order: This property specifies the sort order  of the primary key column in the exported table (database table, spreadsheet, CSV file, XML Node), if this container generates a new table. Default value is set to 1000.

Export Keys: This property specifies how keys are exported for this container. This property applies only if the agent is configured to export to file.

  • Default: Default indicates that Primary key exported for the container. 

  • None: Indicates that no any key will be exported.

  • Primary: This option allows users to export Primary key only.

  • Parent: This option allows users to export Parent key only.

  • Both: This option allows users to export both Primary and Parent keys.

In addition, there is another 'Export Keys' property available under Data->Export Target->Export Keys. This must be set to either "Row Counter" or "Always"

Export Method: This property specifies how to  export data from this container. Default value is set to “Add Columns and Rows” which allows users to add columns and rows. There are different ways in which we can extract data:-

  • Separate Output: This property allows users to export data in separate file.

  • Add  Columns And Rows: This property is used to add columns and rows.

  • Add Columns Only: This property is used to add columns only.

  • Add Columns and Merge Rows: This property is used to add columns and merge rows.

  • Convert Rows Into Columns: This property allows users to convert rows into columns

Export Name: This property specifies the name of the exported table (database table, spreadsheet, CSV file, XML Node), if this container generates a new table. The command name is used if this property is empty. If multiple agents are exporting data to the same table, then you must set this option to the same value for all those agents.

Export Parent ID Name: Specifies the name of the parent key column in the exported table (database table, spreadsheet, CSV file, XML Node), if this container generates a new table. The parent ID column name is used if this property is empty. If multiple agents are exporting data to the same table, then you must set this option to the same value for all those agents.

Export Parent Sort Order: Specifies the sort order of the parent key column in the exported table (database table, spreadsheet, CSV file, XML Node), if this container generates a new table. Default Value is 1000.

Export Rows to Columns Name Command: When "Export Method" is set to "Convert Rows Into Columns" this command provides the names for the new columns.

Export Rows to Columns Value Command: When "Export Method" is set to "Convert Rows Into Columns" this command provides the values for the new columns.

Export Validation Error Handling: Specifies what action to take when data validation fails on an export data row. Default value is set to “ Remove Row and Increase error”.

  • Remove Row and Increase Error: Remove Row and increase error when data validation fails.

  • None: This will not remove any row when data validation fails.

  • Remove Row:  Removes row when data validation fails.

  • Trigger  Failure: Trigger Export fails when data validation fails.

History Table Name: Specifies the name of the database table containing historical data if this container generates a new table and the agent is configured to store historical data in separate database tables. The command name appended with "History" is used if this property is empty. If multiple agents are exporting data to the same table, then you must set this option to the same value for all those agents.

Plural Export Name: Specifies the plural name of the exported table if this container generates a new table. The "Export Table Name" with the added character "s" is used if this property is empty. This property can be used to control the name of XML nodes when exporting to XML.

Row Count Container: Data exported by this container command will be used for row count and pagination when using the API. The container command must export to a separate data table. The Agent command is used as Row Count Container by default.

Templates

Template Name:  The template path of the referenced template.

Use Template Reference:  Loads this container from a template when the agent is loaded. Default value is False.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.