Click text link in table

Hi Friends,

We are doing ui automation in our website. When you select the “Event Result” button in the upper right corner, the following data table will appear. We need to select the link of column “Event Description” to go to the next page, just select “突發性銷售避免過多自動補貨SKU 申報” and the line with status as “Active”.

I tried to use Find Element and Click unsuccessfully. Is there a problem?

Thanks & Regards,
Tiger

Hi @tiger_wong

Did u mean that u need to select the event description having status as Active?

Hi @NIVED_NAMBIAR

Yes, only if Active and Description are “突發性銷售避免過多自動補貨SKU 申報”. Thanks.

@tiger_wong

-Use the Data scrapping Activity
Store the output value as Dt_Scrap

-Use Assign Activity
Assign Count_IDX = 0

  • Use For Each Row in Data Table
    Enter Input Data Table As Dt_Scrap

-Use If Activity
Expression → Row(“Status”).Tostring.Contain(“Active”) And Row(“Event Description”).Tostring.Contain(“突發性銷售避免過多自動補貨SKU 申報”)

Then
-Use Click or Click Image Activity
1) Indicate the second Description “Link” and you will find IDX in the UIExplorer Attribute
2) You need to choose a variable as Count_IDX instead of the number in the IDX

Else
-Continue Activity

Hope it will works
Let me know if you face any issues

Regards
Gokul

Hi @tiger_wong
Either u can try the datascrapping method or try the click activity
If possible can u show the selector of the Description part in ui explorer?

Hi All,

I try to doing the Ui explorer part, but I cannot find the IDX attribute. Thanks.

-Use the Data scrapping Activity
Store the output value as Dt_Scrap

-Use Assign Activity
Assign Count_Tablerow = 0

  • Use For Each Row in Data Table
    Enter Input Data Table As Dt_Scrap

-Use If Activity
Expression → Row(“Status”).Tostring.Contain(“Active”) And Row(“Event Description”).Tostring.Contain(“突發性銷售避免過多自動補貨SKU 申報”)

Then
-Use Click or Click Image Activity

  1. Indicate the second Description “Link” and you will find Tablerow in the UIExplorer Attribute
  2. You need to choose a variable as Count_Tablerow instead of the number in the Tablerow

Else
-Continue Activity

Hope it will works
Let me know if you face any issues

Regards
Gokul

hi @Gokul001

When the original number is replaced by Count_Tablerow, invalidate occurs. Thanks.

Yes it will occur try to run with that hope it will click on the crt column

Hi @tiger_wong,

Ok there is an alternative to scrapping and filtering rows. In theory this will also be faster (I dont know the website structure). You can skip data scraping if you only want to go to the next page (click on the URL link in the Event Description)

In any HTML table the tableRow can be used instead of IDX and I see you have at tableRow selector on the Event Description UiExplorer screenshot.

Approach:

  1. Check if you have successfully navigated to “Event Result” table by using Element Exists in or Check APp State ( if you are using Moder Expierence) on the Table

  2. Prepare your tableRow value as a variable and in the UiExplorer use the tableRow selector

  3. Optional: Scrape Table using Data Scrapper. This way you can use the table to get the number of rows in the UI. Just for getting number of rows not for any filtering.

  4. If you dont scrape the table use

    The try catch will ensure that if the rowNumber is higher than the tableRow variable then your automation will not stop, but it means that you have come to the last row of the current page.

    Within the for loop you can use Get Attribute and read the URL of the Even Description column at rowNumber (tableRow). This way you can extract the URL for each row. If you want to have it in your scraped datatable later you can also choose to do that.

You can also get the values (Get Attribute—>innertext) for your filter on Status by using the same logic but getting text of Status and Description.
So there will be some if conditions in this step to only get urls where your if conditions are met.
5. Pagination: If your table has multiple pages then you at the end of Step 3 click on next

We use this approach and has worked flawslessly. We use Step 3 so that we dont need to have a Try-Catch in Step 4.

Hope this helps!

Hi All,

I tried many times and the following error occurred. It can’t find tablerow? How can I solve it? thanks.

Hi @tiger_wong

Can you share the Workflow ?

Regards
Gokul

Hi @Gokul001

First use Data Scraping to import the data table, then use For Each Row in Data Table to loop the data table, and add the condition, and finally Click to move the selected link to the next page.
The following is a screenshot of the program. thanks.

@tiger_wong

Can you share the Ui Explorer for that Click Activity

Regards
Gokul

Hi @Gokul001

Please find the following picture. Thanks.

@tiger_wong

You can Check the TableCol and run it?

Regards
Gokul

@Gokul001

The error is same. Thanks

@tiger_wong

Can you able to share the xaml file?

Regards,
Gokul

Hi @Gokul001

Thanks.
Main.xaml (49.8 KB)

@tiger_wong

  • You can try with unchecking the Tablerow and Tablecol

  • you need to check the aaname or innertext

I can’t access the site in your xaml file

Give a try and let me know

Regards
Gokul