Solution to Clicking a button on a Salesforce Browser Popup Dialog - Can I post a solution?

Hello, I’ve been working with UiPath for a couple of weeks and was hit with an issue of handling a Click on a Browser Popup originating from a Salesforce Page. I referred to a previously closed post Click on Pop up message doesn't work - #14 by Vivek_Arunagiri, but the solutions there did not work for me.

I did manage to create a workaround. Can I post the solution here?

Thanks

1 Like

I’m sure that would be fine, I know I’d be interested in seeing it.

Great! I will do it in a few :smile:

Stay tuned!

The Problem: My RPA workflow reads an Excel, looks up our company’s Salesforce Page and hits the Delete button. Once, the robot clicks on the Delete button, a Browser Dialog pops up asking for a confirmation on the Delete. At this point, the workflow fails and the Robot stops the workflow complaining that it couldn’t find the Delete (tag=‘INPUT’) button.

From my observations, the robot is most likely losing the bearing on the Delete button, because the active focus is stolen by the large Blue OK button as soon as the Delete button is clicked! The result is no different, regardless of which Delete button is clicked.

I tried all the fixes described in the older forum thread mentioned in my opening post, but none of them worked in the Evaluation version 2019.4.4 of UiPath.

The Simple Workaround:

  1. I moved the Click event into a Try-Catch container.
  2. In the Catch section, I put in a Delay event deliberately to help in the debugging process.
  3. Lastly, in the Finally section, I added a Send Hot Key action to send an (enter) key press to the screen.

The following events occur with this workaround:

  1. The Robot clicks on the Delete button as usual
  2. But this time, the error is trapped by the catch container
  3. The Delay activity in the catch container pauses the workflow for a couple of seconds
  4. By this time, the Browser dialog box has popped up and the Blue OK button has got focus
  5. The Finally section sends an (enter) hot key click to the window
  6. Because the Blue OK button has focus, it’s clicked by the Hotkey action and the Delete operation succeeds!

The images below show the Workflow fixes, and the before and after scenarios of the Delete operation.

Result:
I’ve tested this at least a couple of times on our Salesforce Page. It’s a bit slow, as the Robot slows down once it encounters the error in the Try block, and then figures out that it must send the hotkey event. The delay is further compounded by the optional 2 second delay added for debugging, which can be removed. But the results are reliable.

Give it a shot! Hope this helps!

2 Likes