10-16-2013 07:28 AM
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 DeviceReplay.SendString("18974") set DeviceReplay = nothing set wshell = Createobject("wscript.shell") Browser("Browser").Page("Page").WebEdit("WebEdit") .Click Browser("Browser").Page("Page").WebElement("WARMIN STER 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.
10-16-2013 07:54 AM
The post below has information related to press keys with devicereplay in order to emulate keyboard functionality.
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: http://h30499.www3.hp.com/t5/Functional-Testing-QT
You can create an account with your HP credentials.
10-16-2013 09:47 AM
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("wscript.shell")
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.