Please guide me if anyone can!
I have to compare the table values from an accounting software with a CSV file. If I am not wrong, the way to do it is to use Data Scraping on the table.
The issue comes when the window to view the table cannot be maximised, thus I can only scrape a limited amount of rows since I cannot view more past the 10 first rows unless I scroll down the table.
My superior told me to use Add Data Row to add the rows that Data Scraping couldn’t get, but how could that be done? I am totally lost.
Does this mean I have to do Data Scraping over and over again? Would that allow for flexibility with the scrapped data? The entries for the table changes, so I need to do must be dynamic/flexible.
First think is just indicate the table in the Ui-Explorer and check in the Visual tree of all the rows of the table are available without scroll (you may not see on the screen but still those would been rendered already on the screen)
If that is confirmed from above, You can use
Find Children activity to scrape the entire table data.
Hope that helps
is there a scroll down button or something?
If there is you can capture the selector(using a click activity or something)
then expand target section in properties and copy the selector here
paste selector in EXTRACT DATATABLE activity
and delete/comment the click activity (since its only for capturing the selector)
if it works but you end up capturing duplicates you can use
remove duplicate rows activity
Would it be troublesome if I ask for an example of how that would be done? Since I need to make it into DataTable to allow comparison between the two, would that mean I have to generate Data Table after Find Children?
No not at all.
But if you can confirm me that first point which I mentioned like if the elements are available on the visual tree of Ui-Explorer even before scrolling ?
Yes, thank you!
They are there, but I don’t know if it’s usable?
It only shows as 10 rows, and I noticed even when I scrolled down more it’s the same. At first I thought it didn’t register the other rows but since it’s the UI, it can only show as 10 rows, right?
This is how it looks on the software. (There are one more row after what you see here).
please add picture for more information
you can put datascraping in a while loop,
While loop steps
data scraping to extract datatable
compare last row of table to last row of previous table
String.join(","c, extractedDt.Rows(extractedDt.Rows.Count-1).ItemArray).equals(String.join(","c, prevDt.Rows(prevDt.Rows.Count-1).ItemArray))
if rows are equal, means we cannot scroll down anymore, so break out of loop
if rows not equal, merge the current extracted table with previous one.
click down arrow
then remove duplicates from result datatable
Thank you so much!! I’m like halfway understanding what you’re getting at I think.
So the data scraping would be in the While loop yes?
Do I insert this as the condition? Do I just copy paste what you’ve graciously given me or is there words I have to change so I can use it? I suppose it doesn’t help I know no
This if it’s not equal I use Merge DataTable, right?
Is the clicking down arrow to repeat the Data Scrapping?
Are you using Data Scarping which is at the ribbon in the studio. if you use this, it can extract the same pattern of information without scrolling down
Use below link for doc
Data scraping enables you to extract structured data from your browser, application or document to a database, .csv file or even Excel spreadsheet. Structured data is a specific kind of information that is highly organized and is presented in a...
try use my template
expand the “While” loop and there are 2 sequences you need to update (i have specified where in the xaml)
data scraping sequence
click “down arrow” sequence
test11.xaml (15.9 KB)
let me know if there are any errors
@beepboop you mean to say you can visually see all the elements in the visual tree ?
Hi Jack! Seems there’s Errors I don’t quite get how to solve.
This confused me, do I make another ExtractedDT variable, since it’s supposed to be DataTable?
Do I make Rows as a variable?
Yep! As per the picture I’ve shown you, unless I mistook what you meant?
Can you upload your xaml here? Ill check
Kindly can you use Find Children it should do the job.
Yes I can do it but I’m unsure how I would use it in tandem with the Data Scraping method?
There is no need for data Scraping
Just use find Children and indentify the container.
Check the result for this(debug), then we can do the additional steps.
@Nithinkrishna , I ran it as debug, and no errors came up but since I don’t know how I would check if it works or not, I assumed it worked.
Add a dummy log activity as a last step to your sequence and toggle a breakpoint on that log.
Just go to the locals panel in debug mode. There will be your variable which is the output of Find Children the collection of UiElement
Just expand it and check the count as well as text inside each to see that’s the elements from which you need to text.
Kindly check this.