Click Text on Web page

Barry John Edwards
June 21, 2016 14:30 NONE
I seem to be having a lot of problems with using the screen scraping feature in Uipath.

The idea of the automation is to search a table within a web page for a given text. So I start the Macro Recorder, select Web and Text → Mouse → Click.

I then select the area of the page where I want to scrape and it opens the Screen Scraper wizard which displays the scraped text. I then copy out the text I want to search and paste it into the Text to be found box.

At this point one thing. The native method of scraping NEVER works in this instance. No matter how clear the text is in the scrape, it claims it’s not there…

Google OCR more than often generates gibberish. But Microsoft OCR seems OK and it seems happy to indicate the required text on the screen and clicks the button relative to it fine…

Until you run it within a workflow. When it gets to this point the automation pauses… and fails with an ActivityTimeoutException. Every time.

I have scraped different areas and UI elements and it never works.

So am I missing something here?

Mihai Badita June 28, 2016 23:39
Never use OCR on desktop applications. That is for Citrix/RDP and needs to be fine tuned.

The fact that Native does not work is unusual. Does the Full Text method return anything?

Second thing is that click text does not work if you have a “space” in your target (it seems that this is the case).

There may be other solutions that work better on web: relative elements or anchor base. Could you put here the selector of the element and its properties in UI Explorer? Probably you might use dynamic selectors instead of click text. Then automate a relative element to it.

Barry John Edwards June 29, 2016 12:15
Hi Mihai, Thanks for your response.

It appears that I was searching for text that did have spaces in. So I have changed the code to use the native method and search for a unique string in the table which has no spaces in and it works! Thanks for that!

It means that my automation can now be driven almost entirely by data.

A couple of things:-

The automation in question clicks relative to the text it is looking for and this is a really cool feature. I have adapted this functionality to always look for text relative to a value in a variable. This works as long as this relative position is constant and is not affected by things such as the length of the string.

I think that the issue with spaces in strings needs to be addressed because it could limit the possibilities of fully automating processes. I was fortunate to find a “unique” string without spaces. Other times I might not be so lucky…