How to automate clicking on multiple text buttons in web application?

I’m using a web application and have a long list of parent categories. When you click on one - it expands a drop down list of children categories under it. I want to click every single parent category so that each one is expanded with its list of children categories. So the list I have is like this (for example):

CategoryABC
CategoryDEF
CategoryHIJ
CategoryKLM
CategoryNOP

Each one expands it’s children subcategories when you click it. How would I automate it to click each one. I can only get it to click the first one and then it stops. There is no pattern to the naming of them - they are all unique.

Hi @Luecke_Anthony,

Welcome to the Uipath Community! :grinning:

You can loop by using a Counter inside the idx of the selector OR you can use datascrapping and use a for each and use click text activity to find each text and click on it.

3 Likes

Thanks! So here I have my table created from the datascrape:

image
(var: ExtractDataTable)

Then I used a “For Each Row” activity to click the text:

But how do I make it so that it clicks each text item from the table, rather than entering each text individually?

1 Like

Just use row(0).ToString or row(“ColumnName”).ToString
The one with 0 is the column number.

1 Like

@Luecke_Anthony

You need to change in the selector to loop using text,

Can you post the selector of two fields?

Thanks

1 Like

Here is the selector in my data table from the data scrape:

Here is the selector in my “Click Text B” click activity inside the for each loop:

image

I’ve tried changing the aaname to wildcards but still no success.

@Luecke_Anthony

You already extracted the aa value to datatable, so you just place a for each row and the value of the datatable pass to that aaname.

I hope it will works

Thanks

1 Like

Thanks! Will give this a try soon and report back.

So I’m still not getting it to work. Maybe I’m confused - should I be adjusting my selector on the data table, or adjusting the selector on the click activity?

Here is my click activity inside the for each loop:

image

Hi @Luecke_Anthony

can you share me the selector you place for the click activity?

Thanks

Sure, here is my selector on the click activity:

image

How would I pass the value of the data-table to aaname?

@Luecke_Anthony

Place click activity instead of click text

Try this

aaname=“'” + row(0).ToString() +“'”

Hope this works

Thanks

So I tried this:

image

image

But it does not validate that as a valid selector. Do I need to create a new aaname variable?

@Luecke_Anthony

Assign a variable and pass the value row(0).tostring()

Ex: Categories = row(0).ToString

Assign the selector to a variable and in that selector pass the value of aa name to categories

If it is not working, can you share the website if possible? save the Webpage and share across

Hope this helps

Thanks

1 Like

So for an example, I can use this site (the logic is the same as what I’m trying to):

So I want to click on each element here to expand it’s drop down:

I have my table from the data scrape:

image

Here is my selector on the data table:
image

Here is my selector on the click activity inside the for each row loop:

image

For this example, how would you get it to click on each of those items to expand it’s drop down?

Here is my current workflow:

Can you clarify how you would implement your suggestions above with this workflow example? I really appreciate the help!

Hi @Luecke_Anthony

Check the workflow

Selector.xaml (10.3 KB)

Hope this helps you

1 Like

This is perfect. Thank you very much for providing this and all of your help!

2 Likes

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