I'm trying to get a text from a textfield with Get Text, but in some cases this field is optional and the robot crashes because it doesn't have anything in the field.
1 Answers
You have multiple options. It's hard to say which one fits best you so here is a pool of possible solutions:
when NOT using the Modern Design, you can easily use the
Element exists
activity, self explainingif you use the Modern Design and miss old activities like
Element exists
, go to the filter dropdown and selectShow Classic
, this way you are now also able to chooseElement exists
you could also wrap such failing activities into a
Try Catch
, then your process wont fail, but aTry Catch
should always be the last way outwhen using the Modern Design, you can try
Find Element
, if the returned object is empty you know that it was not found, make sure to set a proper Timeout here, otherwise you wait for 30 secondsbut on your case it could be better to use an
Image exists
orFind Image Matches
as you said you are looking for text in a textfield, just inverse it and look for an empty textfield, and if you have no matches all is fine
But to be honest, I would go for the Element exists
. Give this a try, but be aware that in the future this activity might be replaced by something else and your process will need a little bit of rework.

- 3,734
- 4
- 40
- 70