Selectors in PDF (Adobe Acrobat) are driving me cray

I am trying to automate the process of adding a digital signature. Since there is no pre-existing activity in PDF package, I am using a traditional Click activity.

I am making my program click on “Sign” button. However, this click activity works sometimes and doesn’t work other times, and it is random!
What bothers me is, when I indicate the element from Click activity, it creates a selector right? Sometimes, it becomes “INVALID”, and sometimes it becomes “VALID” even though the pdf condition is the same.

The selector does not include any idx values. This is driving me crazy. Why does it work sometimes and not work other times? I understand that idx values can keep changing each time, so I got rid of it. Even the same selector doesn’t work that was working before. And this is not a browser, so the element tags shouldn’t change unless I do update.

Is this some kind of bug? How can I make a selector generic and work with certainty?

Can you utilize hotkeys or the keyboard shortcuts instead? Then when actually clicking onto the PDF to insert the signature you can try utilizing screen coordinates. It all sounds like a pretty fragile workflow though

1 Like

Actually I thought about using hotkeys too, but there seems to be no short cut for selecting “Sign” button. I googled that too.

And I am actually using screen coordinates for clicking on the pdf sheet. I have to select the area to put the signature, but I cannot rely on the selector here. So I am using the x and y coordinate based on where the last cursor position is.

The problem is, my program doesn’t click on the Sign button, which has no keyboard shortcut for.

@tomato25 what version of adobe are you using? Can you show me the selectors you’re trying to use within UiExplorer?

I am not 100% sure what you’re referring to with the sign button, but I tried using the Tools–>Sign & Certify–> Sign Document and found a working a selector as seen below (you’ll have to change the title attribute or use a different selector yourself though). The only problem is that you have to ensure that it is visible within the menu otherwise it won’t work. So I’d first use an element exists, if it doesn’t exist, click the tools button. Then use another element exist for the Sign document button. If it doesn’t exist, click the Sign & Certify menu. Then click the sign document button.

<wnd app='acrobat.exe' cls='AcrobatSDIWindow' title='ApprovedExpenseReportExport_Reconciliation*' />
<wnd cls='AVL_AVView' title='AVTaskPaneView' />
<ctrl name='Sign Document' role='push button' />

1 Like

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