These basic conditional logic hooks are integrated into Botium. They will only be executed if specified conditions are met.
Conditional Time Based
This logic hook can be used only as a Bot Step. Read more about Conditional Bot Steps here
Overview:
This logichook checks if the current time is between the time period defined in the parameters. It can be used to validate the bot response when the bot gives different answers based on the current time.
- On the left navigation pane, head to
Botium Tools & Settings > Test Sets > Your Test Set > Test Cases
- Click the + NEW button to add a new Convo, or select a previously created test case from the list.
- Add a new + BOT STEP
- Click the Edit icon, or anywhere inside the step, and search the list
for the 'Conditional Time Based' logic hook.
-
Configure the Logic Hook:Note: The parameters must be specified in a JSON object.
- Condition Group ID: Optional - If required, specify an ID for the Condition Group. Read here for more information on how to handle conditional groups
-
Parameters as JSON Object: Click the INSERT SAMPLE button to generate a sample JSON object for the parameters, or enter the parameters directly.
- Start: The start time of the period in mm:ss format (e.g. 08:01).
- End: The end time of the period in mm:ss format (e.g. 16:55).
-
TimeZone: Optional - The chatbot timezone can
be specified, otherwise the Botium server timezone
will be used . For more info on timezones see the
time zone identifier list - List of tz database
time zones - WikipediaNote: The start and end times are inclusive in the time period calculation.
This is an example of verifying the chatbot greetings based on time:
- Click the APPLY CHANGES button to complete the step entry.
#me
start conditional time-based logic
#bot
CONDITIONAL_STEP_TIME_BASED {
"start": "8:00",
"end": "16:30",
"timeZone": "Europe/Vienna"
}|exampleGroupId
-
CONDITIONAL_STEP_TIME_BASED
sets up a conditional logic based on the specified time parameters. In the example, the condition groupexampleGroupId
applies during weekdays from 8:00 AM to 4:30 PM
Conditional Business Hours
This logic hook can be used only as a Bot Step. Read more about Conditional Bot Steps here
Overview:
This logichook checks if the current time is between the time period defined in the parameters. It can be used to validate the bot response when the bot gives different answers based on the current time.
- On the left navigation pane, head to
Botium Tools & Settings > Test Sets > Your Test Set > Test Cases
- Click the + NEW button to add a new Convo, or select a previously created test case from the list.
- Add a new + BOT STEP
- Click the Edit icon, or anywhere inside the step, and search the list
for the 'Conditional Business Hours' logic hook.
-
Configure the Logic Hook:Note: The parameters must be specified in a JSON object.
- Condition Group ID: Optional - If required, specify an ID for the Condition Group. Read here for more information on how to handle conditional groups
-
Parameters as JSON Object: Click the INSERT SAMPLE button to generate a sample JSON object for the parameters, or enter the parameters directly.
- Days: Array of the days, which are considered at the time period check (e.g. ["Monday", "Tuesday", "Wednesday"]).
- Time period: Optional - You can define a time period with start and end time. If it is not specified then the days will be checked from the days array.
- Start: The start time of the period in mm:ss format (e.g. 08:01).
- End: The end time of the period in mm:ss format (e.g. 16:55).
-
TimeZone: Optional - The chatbot timezone can
be specified, otherwise the Botium server timezone
will be used . For more info on timezones see the
time zone identifier list - List of tz database
time zones - WikipediaNote: At a minimum, either the days or the start and end times must be specified. The start and end times are inclusive in the time period calculation.
- Click the APPLY CHANGES button to complete the step entry.
#me
start conditional time-based logic
#bot
CONDITIONAL_STEP_BUSINESS_HOURS {
"days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"start": "8:00",
"end": "16:30",
"timeZone": "Europe/Vienna"
}|Group 1
-
CONDITIONAL_STEP_BUSINESS_HOURS
sets up conditional logic based on the specified business hours. In the example, the condition groupGroup 1
applies during weekdays from 8:00 AM to 4:30 PM in theEurope/Vienna
time zone.
Conditional Capability Value Based
This logic hook can be used only as a Bot Step. Read more about Conditional Bot Steps here
Overview:
This logichook checks if the capability value is equal to the given value from the parameters. It can be used to validate the bot response when the bot gives different answers based on a capability value(E.g. Mobile or Web chatbot connection).
- On the left navigation pane, head to
Botium Tools & Settings > Test Sets > Your Test Set > Test Cases
- Click the + NEW button to add a new Convo, or select a previously created test case from the list.
- Add a new + BOT STEP
- Click the Edit icon, or anywhere inside the step, and search the
list for the 'Conditional Capability Value Based' logic
hook.
-
Configure the Logic Hook:
- Condition Group ID: Optional - If required, specify an ID for the Condition Group. Read here for more information on how to handle conditional groups
-
Parameters as JSON Object: Click the INSERT SAMPLE button to generate a sample JSON object for the parameters, or enter the parameters directly.
- capabilityName: The capability, which value will be checked.
- value: The expected value.
- jsonPath: Optional - You can define a json path, if your capability is a json object and you would like to check a specific property of that.
- Click the APPLY CHANGES button to complete the step entry.
#me
start conditional time-based logic
#bot
CONDITIONAL_STEP_CAPABILITY_VALUE_BASED {
"capabilityName": "CHATBOT_TYPE",
"value": "Mobile",
"jsonPath": "$.optionally.define.jsonpath"
}|capabilityGroup
-
sets up conditional logic based on the specified capability values.CONDITIONAL_STEP_CAPABILITY_VALUE_BASED {"capabilityName": "CAP_NAME", "value": "value", "jsonPath": "$.optionally.define.jsonpath"} | my_capability_group
- In the example, the condition group
capabilityGroup
applies if the capabilityCHATBOT_TYPE
has the valueMobile
and optionally uses thejsonPath
to define a specific path.
Conditional JSON Path Based
This logic hook can be used only as a Bot Step.
Overview: This guide explains how to set up a logic hook in Botium to apply conditional logic based on JSON Path expressions.
- On the left navigation pane, head to
Botium Tools & Settings > Test Sets > Your Test Set > Test Cases
- Click the + NEW button to add a new Convo, or select a previously created test case from the list.
- Add a new + BOT STEP
- Click the Edit icon, or anywhere inside the step, and search the list
for the 'Conditional JSON Path Based' logic hook.
-
Configure the Logic Hook:
- Condition Group ID: Specify the Condition Group ID.
-
Params as JSON Object: Click the INSERT SAMPLE button to
generate a sample JSON object for the parameters, or enter the
parameters as a JSON object directly.
- Click the APPLY CHANGES button to complete the step entry.
#me
start conditional JSON path logic
#bot
CONDITIONAL_STEP_JSON_PATH_BASED {
"jsonPath": "$.jsonpath.on.botMsg",
"value": "value"
} | JSONgroup
Explanation:-
sets up conditional logic based on the specified JSON Path expression.CONDITIONAL_STEP_JSON_PATH_BASED {"jsonPath": "$.jsonpath.on.botMsg", "value": "value"} | JSONgroup
- In the example, the logic hook checks if the JSON Path expression
$.jsonpath.on.botMsg
evaluates tovalue
. If this condition is met, the logic groupJSONgroup
is applied.