2

I'm new to UFT and I'm trying to select element from the Auto suggest list using Record and Play option of UFT. this is my recorded script for auto suggest list

Browser("Log in to iCare").Page("iCare_3").WebEdit("Start typing your medication").Set "AMLODIPINE TAB"
Browser("Log in to iCare").Page("iCare_3").WebList("AMLODIPINE TAB").Click

But when I'm running it UFT just setting AMLODIPINE TAB option in text box and not selecting the option from the list so due to this I'm not redirecting to next modal view.

I have also tried SendKeys but still it is not woring

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "AMLODIPINE TAB"
wait 3
WshShell.SendKeys "{DOWN}"
wait 3
WshShell.SendKeys "{ENTER}"
wait 3
Set WshShell = Nothing

Please see attach screen short enter image description here

Waiting for reply..thank you

Krishna Patel
  • 275
  • 5
  • 19

2 Answers2

1

It may be that UFT's WebEdit.Set command doesn't simulate the specific events the application is looking for. In such cases using device replay usually solves this problem. See this answer for more details.

tl;dr; Try this code:

origReplayType = Setting.WebPackage("ReplayType")
Setting.WebPackage("ReplayType") = 2 ' Changes to device mode
Browser("Log in to iCare").Page("iCare_3").WebEdit("Start typing your medication").Set "AMLODIPINE TAB"
Setting.WebPackage("ReplayType") = origReplayType ' return to previous mode

Browser("Log in to iCare").Page("iCare_3").WebList("AMLODIPINE TAB").Click
Motti
  • 110,860
  • 49
  • 189
  • 262
0

You can use

Browser("Log in to iCare").Page("iCare_3").WebElement("Html Tag:=li","innertext:=AMLODIPINE TAB").Click

instead of

Browser("Log in to iCare").Page("iCare_3").WebList("AMLODIPINE TAB").Click

this might be work and if not then try it with

Setting.WebPackage("ReplayType") = 2