What can I do to check a word "remove" in the entire webpage and Click on the button

I am working on a shopping web application .
Encountered an issue at the validating cart level.

Scenario : Click on cart → opens cart page → looks at all other added products → Every added product row will have a button “remove” at the end. → Click on remove → move on to next step

Issue: What if there are 3- 10 other different products added to cart , We got multiple Remove buttons throughout the page .

Seeking advice on what to do to recognize all the available “Remove” on the entire page and then click on all of them → move to next step

Note : I tried element exists and can do this with Do while loop . Is there any way to search entire page ,find all the words and then click on all them (shorter way)

Hello @sharath.vattikunta ,

In your case you have multiple Remove button and you need to click on those for removing the item from the card. So you need to use the click activity to action the removal.

Then the question comes here is how you can loop to all the items and click on the remove button. You can do as below.

First try to inspect of any of the 2 Remove buttons using Ui explorer and check whether any row number is there in the selector…( for eg: idx=1, idx=2… or rownum=1, rownum=1 …)
If it is there, you can use a while loop:

while(i<15) consider maximum 15 remove buttons are there.
Click activity (need to dynamcially click on the remove button by passing idx=i)
i=i+1
Element exists ( same element whcih you used for click activity, but here i will increment to 2, it means it will check the next button)
If condition ( if Element exists) add some delay
else use break activity.

Thank you Rahul

@sharath.vattikunta

Instead of Idx you can try with other difference like Row or some other tags which are different from one another then you can make a loop to increment the count

Hope this may help you

Thanks

1 Like