I am using Anchor base activity to download some report. The report is in graph format. So basically I need to use the caption of the graph as the anchor then right clicking on the graph and downloading.
Thing is the captions are in text format in some places and in image format in some other places. So the Find Element is not working where the caption is in image format.
How to handle it so that irrespective of the format the find element should work ?
Thanks. Its working but in the screen there are two strings like âabcâ and âabc 12â. So when its searching for abc using Find OCR its first fetching the âabc 12â not âabcâ. Then when its searching for âabc 12â then also its fetching the same âabc 12â.
Please give more details like⌠my anchor base is ⌠and my field is ⌠Are you searching for âabc 12â or âabcâ as anchor base or your field ?
You might be able to use the âOccurrenceâ property so it only fetches the specific one, but that might not work for you.
If notâŚ
One way to get this to work might be to first find the text position (maybe use âFind OCR Text Positionâ). Then, using the output property, store to an element variable. Place this element variable into the Set Clipping Region, and extend the regionâs width so you can cover the extra characters (search forums for examples of this). With the same element variable with new region, use in a âGet OCR Textsâ with the element as the Target. Now, you can compare the entire text with the text you are searching for, which can give you a Boolean result.
Now, youâll need to use this inside a Retry Scope or Do while and set the Occurrence to a variable in which increments each retry and use a âIs Trueâ (Microsoft.Activities) to compare the text as I mentioned.
This way, during the loop, you will have found the element that contains the text you are looking for, which then you can use that element variable in your anchor base.
This isnât something Iâve done myself (since there is usually a way to interact using selectors), but I feel it could work, if you choose to try this.