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”.
-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
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?
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:
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
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.
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.
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.