Hi @Chand,
This is the whole process:
I used the FindText activity inside a loop and searched for the text considering its occurrence number, and always storing the result element in a variable x. After it, I used the InvokeMethod activity to call the ExpandClippingRegion method of x (TargetObject: x; MethodName: ExpandClippingRegion), passing the parameter LEFT from UiPath.Core.Direction enum. I repeated this invoke activity passing the RIGHT direction, expanding the element for right and left. So imagine you are searching for the word Support and you have the following:
Support Price
Ask for Support
Support
In the first occurrence, after implementing these invokes and using the scrape method you would be able to get the entire text “Support Price” instead of only “Support”, and then check if it is really the word you are searching for.
For using the scrape method, follow the syntax below:
x.Scrape(new ScrapeOptions()).Text
The expression above will return “Support Price” in the first iteration.
Hope it helps you.
Regards,
Bruno Costa.