Problems with click text activity

Hi Guys

I am getting the following error with the click text activity.

Error Message:

Click Text ‘DIV’: The method or operation is not implemented.

Any ideas on how to resolve this?

Check where UiPath is showing exclamation marks. I believe you’re missing an input parameter to the activity.

1 Like

I am not sure what I am missing?

What is Target set to when the workflow reaches this activity?

1 Like

It is empty.

image

The selector needs to be set in order for the activity to work. You can use UiExplorer to find what that selector should be, and enter it into this field in quotes.

I am using Click Text because I want it to work dynamically. If I include the selector it will become static.

The selector must be made dynamically. Depending on the use case, this will involve using a variable to iterate over an idx attribute or using the Fuzzy or Regex features of UiPath.

What is youre use case?

1 Like

I am basically trying to find a tweet on twiiter by name and selecting it dynamically. I have used screen scraping to scrape the entire twitter page using full text. Then I am using the Matches (Regex) activity to pass in my pattern (tweet). Am then using an if statemnet to check that outtput from regex matches string. Then using click text to select it by passing in the name of the tweet in text of the target option.

If there is a better way man. I would love to hear it.

Twitter posts are likely organized in a hierarchy, where the posts are in that hierarchy. Check if each post has an idx value. Then you can check if the tweet you’re looking for is the correct one by getting the text from each post and evaluating it.

Using ClickText runs the risk that there are multiple elements with the text on screen, and UiPath won’t know which one to click.

1 Like

Hi Anthony

Ok that makes sense. It does have an idx number. I do not know to use this though. Can you please help?

First, you’ll want to open this in UI Explorer. Then choose attributes which will make this selector more stable. The attribute with the >dif>article data is not stable.

Next, create a While loop set to a boolean DataExists (which should be set to True initially). Add an Element Exists activity with your refined selector, and output the result to DataExists. You’ll also need a variable PostId set to 1 at the start, and pass this in for idx. You can do this by deleting the current idx in your selector, and right clicking. This will give you the option to insert a variable into your selector.

Then, add an If activity, and if DataExists is true, check if this is the right item. If it is, do what you need to do with the item, and break from the loop (Break activity). Otherwise, increment PostId by 1 using the Assign activity.

Your loop will end once the item is found or once there are no more items to read.

1 Like

Hi Anthony, I am confused with how to bulid this. Can you provide me with an example, if possible?

I’ve attached an example. It’s a heavily-nested workflow, but it can be broken down into separate workflows for readability. You will need to fill in the details for your use case for it to work.

Processusvierge.zip (838,4 Ko)

1 Like

I will give it a go and let you know. Thank you.

Hi @Anthony_Humphries.

I have tried using your method of replacing the indexes in the selector but I do not understand how to check the value of the index in the if condition? Do you look at the selector.value(or something?) compared with the name of the tweet which I have stored in tweetName?

I have tried another method of replacing the innerText of the tweet with the scraped value and that seems to work fine. I am interested to knwo how to work your approach as well though to expand my knowlegde. Can you please share?

Also thank you so much for your help so far. :slight_smile:

Use the Element Exists activity. Once the index becomes too high to match with a valid element on the page, Element Exists will return False. That will be your signal that you’ve hit the bottom of the page.

1 Like

@Anthony_Humphries I understand that part. How do you return the data that is found from the element exists to do a comparsion?

If you use the For Each Row activity, you can iterate over the rows you’ve filtered. Then you can get the data with row(<FieldName), where <FieldName> is the name of the field you want to compare or modify.

1 Like

Ah I see. But I have not created a data table to do a for each to. Sorry man. I am just stupid. I do not understand.Thanks for your detailed responses.