TestProject Forum

How to count the number of items

Hello
help please solve the problem
How to count the number of items so that you can then use the value of the variable for the correct number of actions to remove items from the cart?
thank you very much for your help

Hi,
You can simply get the xpath like in the picture below:

Then from this xpath remove the part that identifies the element number for example in this case it would be [1]

Before it’s removed:

After:

As you can see I get 8 results as I’m counting the icons in this case.

Now I’m simply gonna use the step count elements using XPATH in the type to count occurrences like in the image bellow:

image

1 Like

thanks for the answer
but but I cannot find such an action

Try to use Count Elements like in the image above

1 Like

thanks, found! get the number of items parameter. I thought I could use this parameter in the repeat field, but I see that it won’t work, it’s a sorry :frowning: