I want to do some clicks/steps in SAP, sometimes there is no data (like in screenshot 1) in this case the robot would be done, but sometimes there is data (like in screenshot 2) than I would like to continue with my robot…
I think an “if activity” helps here: But not sure what to put there and how.
Use an element exists activity and indicate the element where no data is found. So, if “Liste enthalt keine Daten” does exist then stop the process AKA Throw BRE.
Update your timeout value in the element exist from the default 30 seconds to reduce the wait time.
Can anyone see my mistake here? I actually think its not to hard, but my robot always go’s left in the if activity, so always to the “then” side, also when there is no “Liste enthält keine Daten”. How can I make him go the “Else” side?
It sounds like the selector needs to be more specific. Have you done tests with the element visible and invisible. Then use a write line with your boolean value to see if it comes back true or false each time.
Its possible the element always exists but is not always visible. In that case, you will need to use a get attribute activity.
you can use pick activity, with pick branch activity. This will check both scenarios, if theres no data it prints “NO DATA”, otherwise it prints “HAVE DATA”
I think its better than using if statement + element exists because pick activity allows you to easily check for more than 2 scenarios, whereas if youre using if and theres more than 2 scenarios it will look messy with many nested if statements