KarenL
August 27, 2018, 1:50pm
1
I have a web pop up as part of aprocess and wanting to click on the text based on info in CSV file
I have read CSV in Flowchart and For each Row in Sequence.
I’m stuck on it selecting the correct text using CLICK TEXT Activity
Ive changed the selector in UI explore so its has aaname=
<html app='chrome.exe' htmlwindowname='selectDepts' title='Select Departments' />
<webctrl aaname='600 Contract Fabrication (600 CONTRACT FABRICATION)' />
Instead of 600 Contract Fabrication … I want it to use the CSV info in column named “Department”
I tried this but get Error
Thanks
loginerror
(Maciej Kuźmicz)
August 27, 2018, 1:54pm
2
Hi @KarenL
The correct syntax to get the column item from a specific row would be:
row.Item("columnName").ToString
This assumes that this code is placed within the For Each Row activity.
KarenL
August 27, 2018, 2:04pm
3
Thanks that made the ! go away … I’m now getting “Selector not valid” when using the below
“<webctrl aaname=”+row.Item(“Department”).ToString+" />"
I must be missing something
loginerror
(Maciej Kuźmicz)
August 27, 2018, 2:09pm
4
The syntax is correct. Could you post the exception error message?
loginerror
(Maciej Kuźmicz)
August 27, 2018, 2:11pm
6
I think I have just had this issue. Could you make sure to retype all the quotation marks and apostrophes instead of pasting them into the selector window?
KarenL
August 27, 2018, 2:15pm
7
Thanks for your help… just retyped and rerun… same error ;-(
I think I need to walk away and look at it it fresh eyes tomorrow
loginerror
(Maciej Kuźmicz)
August 27, 2018, 2:23pm
8
The easiest way would be to first try if it still works without using the variable. I would try to fix it as follows:
Indicate on Screen again for your Click activity
test if it works
without opening the Selector Editor, copy the selector string directly from the Selector field
paste it into notepad
prepare your entire variable string
" + row.Item("Department").ToString + "
simply paste it into the selector that is in notepad on top of the value that is there
copy and paste this modified selector to the Selector field in UiPath
give it a go
KarenL
August 27, 2018, 3:01pm
9
Thank you thank you … it now works
I re-recorded it and it added activity as just CLICK (not click text)
Then I did what you said and ended up with
If I want a wildcard at the end … as the CSV will only have for example
600 Contract Fabrication
and the Web page shows
600 Contract Fabrication (600 CONTRACT FABRICATION)
will this work?
…ToString+“*’ />”
loginerror
(Maciej Kuźmicz)
August 27, 2018, 3:09pm
10
Yes, it should work with the wildcard