How to use getAttribute with if condition

Hi,

I have a scenario where I am fetching one button using find element, if that button exists then it goes to get attribute and save it in a variable viz msp.
But when the button exists then it is giving me this error

also, can I change msp data type from UiPath.element to some string or boolean so that I can use that ivariable information in my if condition.

Thanks in advance

Hey,
You can use the element exist activity. The boolean output of this activity can be further used in the if condition. Then you can simply use the get full text activity to get the button text.
Hope this helps…
Please mark it as solution if it helped you…

@Sameer_Mahajan

I cannot find element exists activity in modern interface.

@Riya_Bansal

Modern activity is check app state …

Or you can always select activities → filter icon → show classic then element exists will be available

Cheers

In one of the properties of Get Attribute you are using the wrong datatype. That’s why it says it cannot convert from string.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.