cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the dynamic text values in IRPA 2.0

0 Kudos

Hi team,

I am automating Task where the bot needs to get the number of items from the shopping cart button.

I have declared a element in application where it shows as 0 items.

The items in the cart may be 1 item or 2 items(i.e Dynamic).

How do i get the dynamic cart values from the shopping cart button.

The element which i have declared doesnt have ID criteria as well and its only recognisable with criteria Text equals 0 items.and its not validating for other criterias.

Please help me with this issue asap.

Regards,

Bhagyashree

View Entire Topic
0 Kudos

Hello,

To avoid this issue, you need to remove the 0 from the criterion Text you put, so that whatever the number of items in your cart is, the element will be recognized. You also need to change the operator from equals to contains in order to always detect this element.

If it's not sufficient, I suggest you to use advanced pattern techniques. More info can be found here.

Let me know if you need more help on this issue.

Thanks a lot and best regards,

Baptiste

0 Kudos

Hi,

Yes i got the output.

Now how do i get only number from that text "1 Items"I have used substring function

var text = Value;

var sub = text.substr(0);

return(sub);

But it gives output as 1 items..How do i get only a number from the text.

MartinaKolafova
Explorer

Hi,

Please consider using "var sub = text.substr(0, text.length - 6);" instead of "var sub = text.substr(0);" to extract the desired substring from the input text.

Martina

0 Kudos

Hi

Yes its worked.Thank you for the solution.