How to handle dynamic drop-down in TOSCA

In every automation tool handling dynamic values is a key factor. In this article, we will discuss some ways to handle dynamic drop-down using TOSCA

In this example, I took their demo site as an example. Kindly use the below approaches based on your requirement

TOSCA Demo 1

The demo site has two customizable options, The First one is size and the second is color. The dropdown contains 4 sizes and 3 color swatches are available

We are going to try selecting the required value in the dropdown. On this website selecting the size is simple but on many sites, dynamic values will be displayed in the drop-down. Use approaches accordingly

Below are some of the ways to handle this drop-down

Approach – 1

This is a very simple approach, dropdown values will be stored in a value range of module attributes and these values can be accessed directly in the test step

Approach – 2

Follow the below steps to perform this approach

Step 1: In Module attribute -> ValueRange, Instead of hardcoded values add buffer. The syntax to use buffer is {B[Buffer Name]}

Step 2: While using this module in the test case, save the required value in the buffer name mentioned in the module. In this example, the buffer name is Size

I think the above 2 approaches would be helpful. Kindly let me know any complexity you are facing in handling dynamic values. Will find a solution together

Thanks for spending your time here.

Leave a comment