Re: Script gets hung up on dropdowns (6881 Views)
Occasional Advisor
Posts: 13
Registered: ‎10-07-2013
Message 1 of 3 (6,920 Views)

Script gets hung up on dropdowns

Hello all,


So I have been using this bit of code below to get past textboxes that generate suggested items from our database as you type. This code/script has been working great the past few weeks, but I have had issue with it the past few days.

myx = Browser("Browser").Page("Page").WebEdit("WebEdit").GetROProperty("abs_x")
myy = Browser("Browser").Page("Page").WebEdit("WebEdit").GetROProperty("abs_y")
set DeviceReplay = CreateObject("Mercury.DeviceReplay")
DeviceReplay.MouseClick myx+5,myy+5,0
wait 1
set DeviceReplay = nothing    
set wshell = Createobject("")
Browser("Browser").Page("Page").WebElement("WARMINSTER PA 18974 USA").Click

 Rather than suggesting dropdown items, it just gets hung up on searching. If I manually type in the digits for a zip code as shown above on the script, the program works fine which leads me to believe I need to make adjustments to the scipt. The webapp I have been using does not even search for suggestions from our database if I use the standard .Set to input the value. So I need a way to mimic keystrokes. If anyone has any suggestions, I would greatly appreciate it.




HP Expert
Posts: 517
Registered: ‎04-12-2012
Message 2 of 3 (6,909 Views)

Re: Script gets hung up on dropdowns



     The post below has information related to press keys with devicereplay in order to emulate keyboard functionality.


Best Regards.


Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

Also remember if you have a valid contract with HP feel free to visit our FT/QTP Support Customer Forums:
You can create an account with your HP credentials.

Occasional Advisor
Posts: 13
Registered: ‎10-07-2013
Message 3 of 3 (6,881 Views)

Re: Script gets hung up on dropdowns

Alright after a little messing around, I got most of our textboxes to work that used the previous code. All I did was comment the follow code out because I really didn't know what the purpose of it was.

set wshell = Createobject("")

 But it turns out that in some cases I did need the code that I commented out. Dont really know why. My knowledge of VB Scribt is very limited, so im assuming it does actually have a purpose.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.