I have a website with the following UI as shown below.
I need to check my “TC Number”(For ex: my TC is 859634/00960023) and click on a button to the right if it is the right TC number or else I check the second “TC Number” and so on…
Great, thanks !
So the exercise here is to find a common link between these two screens, but also the main difference.
Here as you can see, on the right of both those two screenshots, we have:
a common “id”, which is rowName and indicates the line where it is (like a horizontal coordinate)
and a very specific “type” for each of them, which is colName for TIC, and tableCol for the button (like a vertical coordinate)
So what are you going to do first is to check: colName, tableCol, and rowName. Once you do it, verify if the selectors are still valid.
Then for both, take the result of the selector in a string and assign it as a hardcoded value (let’s call them selector_tic and selector_btn)
Then send us in text format the selectors so we keep going ^^
selector_TC: "<webctrl aaname='# TC Number Buyer Name TC status Buyer PO Number Net Weight (kg)*' tag='TABLE' /> <webctrl tableCol='2' tag='TD' colName='TC Number' rowName='1' />"
Sure !
I didn’t see that you answered x)
Ok after this, we have to edit a little bit more your hardcoded selectors so they become dynamic as NIVED_NAMBIAR said.
"<webctrl aaname='# TC Number Buyer Name TC status Buyer PO Number Net Weight (kg)*' tag='TABLE' /> <webctrl tableCol='2' tag='TD' colName='TC Number' rowName='+"index_of_row.toString+"' />"
index_of_row is supposed to be an Int32 that will contain the index of your row.
Next step is to see if UiPath is able to extract the page you’re showing us into a datatable.
Click on the following button, and indicates the field 859…23; it will ask you if you want to extract the whole datatable (you can say yes or no it doesn’t matter), then it will ask you to target another element of the same type (so you will have to indicate the next field TC Number in the line 2), then it will ask if there are more pages to scrape (if yes indicate the “next” arrow down the page)
Yes it scraped the data. I could see it in the output panel.
I have added an Input Dialog box just before the data scraping so that the user inserts the TC number and is stored in a string variable called “inputTCNumber”.
We could cross-check with the ExtractedDataTable and click the right button.
I have removed the double quotes around “index_of_row.toString+” as I was getting an error. They are now as such:
"<webctrl aaname='Edit TC' tableRow='2' tag='BUTTON' rowName='+ index_of_row.toString +' tableCol='10' >"
"<webctrl aaname='# TC Number Buyer Name TC status Buyer PO Number Net Weight (kg)*' tag='TABLE' /> <webctrl tableCol='2' tag='TD' colName='TC Number' rowName='+index_of_row.toString+' />"`
@Yudhisteer_Chintaram1
You need the double quotes so that UiPath Studio understands that index_of_row is the int32 and not a string expected in the selector x)
Would you mind showing me what is the error ?
loop in the ExtractedDataTable with a foreach row activity, and in the output index put index_of_row
inside the foreach row, use an IF activity with the following condition:
inputTCNumber = row(“TC Number”).toString
Then use assign activity, with selector_btn = "<webctrl aaname='Edit TC' tableRow='2' tag='BUTTON' rowName='"+(index_of_row+1).toString+"' tableCol='10' />"
Then use click activity, and in the input, at the field selector, put selector_btn
It is okay now. Earlier you wrote: '+"index_of_row.toString+"'. It should be: '"+index_of_row.toString+"'. The first plus sign should be inside the double quotes. A typo
The TC selector is as such in one line though:
"<webctrl aaname='# TC Number Buyer Name TC status Buyer PO Number Net Weight (kg)*' tag='TABLE' /><webctrl tableCol='2' tag='TD' colName='TC Number' rowName='"+index_of_row.toString+"' />"