Unable to Press a Button on a Web Site

I’ve run into a problem that I’ve been unable to overcome so would appreciate some help to understand its cause and to create a workaround.

The requirement is simply to press a button on a Banking Web page. So only two activities should be needed, to attach the page and then perform a click on the button element.

But the robot is unable to find the UI element for the button no matter where I start the robot or how I edit the selector. In the attachment is a screenshot of the Web page, the activities making up the recorded sequence, the error message and a view of the button target using UiPath explorer:

View Previous Statement Issue.pdf (1.1 MB)

On the Web page you’ll see two other buttons alongside the “View Previous Statements” button. I can’t get the robot to recognise these to elements either. But I have created another sequence successfully on the same page that enters the dates and format needed to initiate a transaction download with a button press. The selector for the “Download” button is:

"webctrl parentid=‘top’ parentname=‘PC_Z7_083Q9FFKO80OISN9Q210000000000000_statement’ tag=‘A’ "

Thanks in advance,
AJ

1 Like

On newer websites, the button might not exist as soon as the page loads. Have you tried adding a ‘On Element Appear’ to check that the element exists before trying to click it?

1 Like

The Web site is years old. “On element appear” for the “View Previous Statements” button just times out. “Element exists” for the button (followed by an “If”) also fails to find the element (no surprise there perhaps!). As both of these activities require the button element to be identified explicitly by pointing at it on the page, I just can’t understand why the robot can’t find them.

AJ

1 Like

Hi @b4bbler,

  1. Try using attach window
  2. Activate window
  3. Click activity properties:
    Wait for ready: COMPLETE
    Timeout:2000
    Note: Check if the selector contains some dynamic data in the field of Title or something else. If it contains some dynamic data then replace it with “*”.
2 Likes

I had the same problem on my project. No matter how much I tried, UiPath was not able to find the button.
Created a workaround with “click image” activity.

1 Like

Did you try editing the selector using UiPath explorer?. You can include more attributes for selecting that button.

The problem appears to be that every time the page is generated a difference reference number is created for three buttons (and probably the equivalent menu options in the left hand pane since I have been unable to click on those either). Using “Citrix recording” and identifying the button using OCR, a “Test Click” on “View Previous Statements” works the first time but when you go back to the page and try again, you get an error: “Object reference not set to an instance of an object”. The page HTML looks like…

The reference numbers that change are highlighted. It’s a bit strange, however, since the “View Previous Statements” button doesn’t have a QLf_refence number.

Here’s the page source after moving to another page and then back…

The selector for the “View Previous Statements” button is:

"webctrl aaname=’ View Previous Statements ’ parentid=‘top’ tag=‘A’

…and for the “View Balances” button (which also can’t be clicked by a robot) is:

"webctrl parentid=‘QLf_103755’ tag=‘A’ "

It appears that the way the Web page works will always defeat a bot - unless someone knows differently.

1 Like

Take the values of selector and copy it to the note pad for first time. Repeat the process for two or three times. Compare these values closely. I suggest you to use wildcards wherever the selector value is changing and try this and i more request: Please use UiPath explorer to get the selector as you can add required attributes and increase your accuracy. In Case if you want to know about wildcards , refer this Selectors with Wildcards

“Take the values of selector and copy it to the note pad for first time. Repeat the process for two or three times. Compare these values closely.”

Good advice! I didn’t see the full scale of the variability until I compared several versions of the same selector (an ID number that varied in all it’s six digits). I did use UiPath Explorer but it only saw part of the variability in the ID number. I had to hand edit the selector.

2 Likes

Thank You. It is working