I have a coupe of library activities which make use of Get OCR Text (the get text activity is not sufficient as the attribute is a code not the actual text). When testing these library activities themselves these work perfectly. However, when these libraries are used in another project I get either “The UIElement is no longer valid” (when it should be) or “Scrape returned empty text” (when it isn’t empty). Oddly, in the later case there are other Get OCR Text activites prior to the ones where the error occurs that execute without error.
Why is this happening? I am using Microsoft OCR with the setting to screen, scaling 5 and wait for ready as complete.
As it’s working properly in one machine one project and you will change the machine and use it in a different or the same project than there might be the chances of changing the resolution.
“The UIElement is no longer valid” (when it should be), this is the selector issue wich you have to recapture it and “Scrape returned empty text” (when it isn’t empty), this looks like the resolution issue.
I’m using the same dev machine in both instances, so I don’t think it’s a resolution issue. I’d also say that the selector is still valid when I check it after failing.
As I stated, it runs fine when debugging within the library file. The issue occurs when executing when called as an activity within another project. Therefore, I cannot use debug to solve this as it takes place within the library activity.