The initial challenge is that the element having, for example, the date of the invoice doesn’t offer enough information to construct a reliable selector:
<ctrl name='2018年5月6日 ' role='text' />. Since the date of the invoice varies, it’s not a very good idea to use it in the selector (by the way, this is similar to what happens in the RPA Automation Challenge).
The sample I posted shows one way to get values from the invoice PDF (in this case, CompanyName, InvoiceDate and InvoiceNumber) without using the Anchor Base activity.
The main idea is to explore the visual tree that represents the PDF structure (left panel of the UiExplorer window):
-First, we can select the row having
rowName='日付' (‘日付’ is a label that means ‘Date’). Since this label probably won’t change for invoices of the same type, it’s a good choice of attribute to include in the selector.
-Also from the visual tree we can see that row has two children (both called
cell), but the text we’re looking for is always under the second child. That’s why we use
idx='2' to arrive to that text.
The tree structure might vary with the PDF, but it’s possible to use the same idea to obtain other information from the invoice.