assignment is => to take single medicine from excel sheet 1 by 1 & then print it at website search bar & then dropdown list will open & from that dropdown list click on the medicine, then page will re-direct to next page of medicine which has full details. stay at details page for 2-3 seconds & then return back to main page & then run a loop for other medicine listed in EXCEL sheet until end of list.
Project details what I made in UiPath sequence:
steps:
read range excel, given path of excel documents
open browser, added url of given website
do for each row in data table, added variable CurrentRow
body => added type into => added website search click
at text wrote formula for excel as "CurrentRow.Item (“DrugName”).ToString
send hotkey => down
after this its list is opening
send hotkey => enter (here error is coming & not going to next medicine details page)
delay 2 seconds at medicine details page
click back & land at main medicine webpage
problem:
at point 8. send hotkey => enter (here error is coming & not going to next medicine details page) after that not working
Result needed :
when medicine name is printed at search bar, after hotkey down,
it should click at 1st medicine & then re-direct to next page of medicine details & then click back & then load main page.
note: website search bar has find button, but it does not works as not provided by client.
only enter medicine name at search bar & at dropdown click on medicine & then land to next details medicine page
Try to add a delay activity before step 8 only for troubleshooting purpose. If it works, probably SEND HOTKEY activity is runnning before list is openning.
If so, you can try
Use Check App State activity to check if the list elements are present
Change activity properties > Target > Wait for page load → Interactive or Complete
@mustafa.diwanji as @rikulsilva just said. I can see only two ways to solve your problem:
First: Verify if you need a delay before the activity;
Second: Change activity properties.
If you need some help, please send a screenshot of the properties
I suggest move the workflow to Modern Activities that you will have much more features like Set Focus, For Each UI Element.
If you want to continue using Classic one, make sure to change the property WaitForReady for Send Hotkey to wait page loads completely.
Also, it is alway a good practice check the element before perfome some action over it. For Classic activity, you can use Element Exists, On Element Appear etc.
Another point… from your screenshot, you didn’t indicated the element you want to press the keys, so the press key affects the element that is in focus.
You can try run the workflow in debug mode going through each activity and with Highlight Elements option enabled to check if the focus is in the correct element before each press key.
I applied WaitForReady for send hotkey,
applied delay times where required,
applied Highlight Elements options & it all helped v well. thanks for this.
At send hotkey as I did not indicate informative screenshot which does not break my project anywhere.
I remove back button click at last & replace it with click on website name (at 2nd page of medicine search) to re-direct at main page - which is also working fine.
working status =>
Now, my 1st name in excel sheet & its flow is working fine at 1st time.
it is typing name from excel, listing down the names with down hotkey, enter on name by hotkey & re-directing to medicine description (2nd page) & then after delay 3-4 second, clicking on website name it is landing at main page of website
problem:
at 2nd time when it re-directs to website 1st page, it is not extracting name from excel sheet & not typing on search bar of website & loop is ending at Type Into INPUT at 2nd time with error at INPUT (screenshot attached)
It is not typing name of 2nd medicine & flow ends with error