How to deal with a dialogue box that doesn't always appear


So I have created a robot that basically extracts invoices from SAP. This particular SAP transaction will take the user into an extra confirmation screen to say how many invoices were printed. However, if there are no invoices for a particular customer then SAP doesn’t take you to the confirmation screen. Now, I specifically designed the robot to do each customer separately to make it easier to organize the invoices. So basically I have the robot repeating the same actions X amount of times in order to run each customer (not so many at a time, maybe about 10-20).

I have it currently set up in such a way that if there were no invoices for any customers it will run successfully (i.e. you didn’t go to the next confirmation screen)! However, I am having a hard time thinking about how to deal with the dialogue box that doesn’t always pop up.

So i put the entire flow of clicking through the dialogue box, and backtracking SAP to the previous screen into a sequence. It will be the same for every customer so I basically copy and pasted that sequence into every customer and I have it set to continue on error after 2 seconds. But this is unreliable and if I keep doing this method I will need to probably put a delay of 10 seconds because some customers have a lot of invoices to print and SAP can take some time to confirm that information. However, this is going to be a lot of wasted time. I thought maybe doing a try catch with the catch being the dialogue box sequence, but then I have no idea how to go back to where I left off on the try to continue on.

Any advice would be appreciated.

Here is a suggestion.

Try an element exists (or image exists for that matter) followed by an IF.

Let me know if it helps

1 Like


Good idea, I forget about using element/image exists!

I used it in a test sample of a few customers and it seemed to work flawlessly. Thanks!

1 Like

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