Hey guys,
I would like to check if an UI-Element in SAP appears or not. Therefore I want to use an if-condition. Is it possible and if so, how would the command look like?
Regards and Thank you guys!
Hey guys,
I would like to check if an UI-Element in SAP appears or not. Therefore I want to use an if-condition. Is it possible and if so, how would the command look like?
Regards and Thank you guys!
You could use Check App State activity. It has branches for cases when the target appears / does not appear.
@marco.roensch ,
Hii ,
Use an Element Exists Activity.Indicate the element.
The output of this activity will be a Boolean variable.
Then use If Activity ,pass the boolean variable in the if condition. Then you can proceed with then or else.
Regards,
Hi,
use below steps:
elementExists
).elementExists
. If it’s true, the element exists; if it’s false, the element doesn’t exist.Refer the workflow for better understanding
Hope it helps!!
Hey guys,
Thank you, these answers are great! But I have the issue that the bot doesnt take the “else” path in case the ui element doesnt appear. It stops ans says “couldnt find the element”.
Do you have any advices?
@Parvathy @neha.upase @Jithesh_R @efelantti
Regards
Can you post a screenshot of your code? You shouldn’t get any exception from the Element Exists, as it should just set False to the output boolean if it doesn’t find the element.
A as tip, it would be a good time to start using the modern version of Elements Exists, which is the Check App State activity. Then you utilize Object Repository and more niceties that Classic activities don’t have Then you wouldn’t also need the
If
, because the activity already contains branches for Element existing/Not existing scenarios.
Just add the activities you want to run in right branch in case element doesn’t appear. Also, you can run in debug mode to check the path your bot is going
Cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.