Need help creating an error handle


I have a script that uses the Click text activity to click on the word “Other” within a web based word processing app. It then inserts different verbiage. My script works fine until “other” is not visible and is a few clicks down on the scroll bar.

I’m trying to write a script that would search for “Other” on a web page. If it is not found Down arrow and repeat until the Click text activity identifies “other” and clicks the text. I would appreciate any help.

Hi @Marc757

I really don’t think you need to follow that approach to find an element on a long web page. Where ever the element is (either in the very bottom or on the very top of the page), a simple Find Element or Element Exists activity can look for it without the need of scrolling back and forth. So let’s say your element usually is at the very bottom of the page. So once the screen loads, you will not see it because you are on the very top of the page. However, even though its not visible to you, the above mentioned activities will do the search in entire page and check whether its available or not.

So just using the activity will work for you. It will be much simpler and efficient than scrolling here and there :slight_smile:

Fine kindly follow the below steps that could help you resolve this issue buddy
—use a retry scope activity for this situation
— here in the top portion of retry scope use set of activities like this
—use send hot key activity with key pgdn
— in the condition part that is the lower part of retry scope activity use a activity called element exists if we are able to select that text as individual element or use image exists activity and scrape that text as image if we are not able to select the text as individual element…let any of the activity be used get the output from these activity with a Boolean variable named bool_exists
—set the property Numberoftretries as 100 in retry scope activity property panel
— next to this use a if condition like this
book_exists = True
— if this condition passes it will go to THEN part of if condition where we can use click text or click or click image activity

Hope this would help you buddy
Kindly try this and let know for any queries or clarification
Cheers @Marc757


I appreciate the assistance. I just tried your suggestion, however, the Click text ‘SPAN’ activity is still failing. UIpath can recognize the element but cannot click on it because it would need to scroll further down so the text is available to click on. For context, this is within a word processor on a web page see screenshot.

I solved this problem by using the try catch activity on the click span text that was causing an error. Then adding logic to page down in the word processing app and trying to click the text again. Thanks for all the suggestions.

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