TestProject Forum

How to count rows for validations? [SOLVED]

I have a list of tasks and I want to count them while validating the correct number of them!

2 Likes

Hello @dardani
You can use count elements, using Xpath for example:


You will get back the number of your elements.
You can also add validations to this step:
image

2 Likes

I’m learning so much from your posts , thanks for this.

1 Like

Hey @kfir.yosef,

Weird, because I don’t have this Action on the list? Is it an add-on?

You need to make sure that you are searching for an Action and not for an Elements Action.

1 Like

As you see, there is no count element on this part!

This is because Click is an element Action and you are trying to replace it with another element Action.
Create a new manually step
image

image

Thank you @kfir.yosef, now is working. I appreciate your help!

1 Like

Hey @kfir.yosef,

Should I create a manual step for each row I want to count?

Right now, I am locating a row through its DIV value, VisibleOnly: True, and when I run the test nothing is showing in the end!

I’d appreciate more details here. Thank you!

Hey, you can see it in the following example:
I’ve changed the xpath to find all the rows in this table by removing [1]

Now I will use this step:


image