Highlighted
Honored Contributor.
Honored Contributor.
836 views

Typing values SLOWLY, using UFT

Hello all,

Is there a possibillity to do this? There are spome edit fields in a web application that I have to enter a value, "like a user". Meaning by this that either there is an auto-complete process that kicks in when typing and then fills in the blanks, or in other cases a security mechanism (like captcha) that blocks fast inputs.

 

Is there a way to do this? Using sendkeys perhaps? Any thoughts over this ?

Thank-you.

 

0 Likes
9 Replies
Highlighted
Honored Contributor.
Honored Contributor.

You can try two options: Both the options can be used to send the text or enter keystokes 

1. Using  wsript.shell object

set oShell = CreateObject("WScript.shell")
oShell.SendKeys(“String to input”)

2. Using Device Replay

Set oDR = CreateObject("Mercury.DeviceReplay")
oDR.SendString “String to input”

I have provided example to send string, but you can use these methods to send keystrokes. Sending keystrokes with each of these methods is different and you will have to look into the codes, which are different than for sending string. 

Hope this helps

GoScriptLESS Create UFT Tests in seconds view demo and more details at scriptlessautomation.com

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Thank-you GoScriptLESS 

How does this differ from a standard "SET" command in UFT?

The SET command , it is like a copy->paste action.

Is there a difference between these commands on *how* they enter the text into the edit-field?

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Guys...

Any insights on this??

Will be very much appreciated !

Now check this out please... This is what I need help for. I need to select the year of birth from the drop down, and this will oipen after starting to type it in it's relevant edit field.

How would it be possible to choose from the  list that appears there?

Please view the attached image.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi,

As for the first problem, did you try the proposed solution?

As for the second, not sure i understand the problem - did you try the select method on the test object ?

Tsachi

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Hi Tsachi,

What do you mean by the SELECT method?

The thing is that I cannot type to the field and leave the text there, as it will be discarded. I have to select the matching value from the drop down list that shows, while I am typing.

Otherwise, my selection is not saved.

If I do it manually, I start typing and then after a few letters the drop down immerges. 

Please see the attached image

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

hi,

I meant, learn the control, it is identifed as drop down right?

Or is it identified as a webEdit?

if it is a dropdown, did you try using the select method?

Tsachi

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

OK ...

When I click a certain icon (the arrow down icon) then this makes the drop down list appear, however I ahve not been able to select a value from that list, although I have learned that object seperately. UFT simply does not do anything with that listbox object...

Please view the ObjRep for this object.

Thing is, with this object and the ones next to it, is that they react to the arrow keys (up/down)...

So that can be an option too... if nothng else works

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Try something like this:

dropDownObj.Select "1996" 'or any value you want from the dropdown as a String

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Well,

 

I tried doing something like this,as soon as I got the listbox open (which was not that easy, as it need to press a specific  icon) the Select method did not select anything from that list. Simply ignored the command.

I tried using keystrokes, which at the moment seem to be the only option . meaning that I have to perform the up or down arrow press in order to select a value one per time.

Not very efficient, but the only thing that works...

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.