Results 1 to 5 of 5
  1. #1
    SQA Knight
    Join Date
    Jul 1999
    Grand Rapids, MI

    can .Type method pacing be configured?

    I have a very unusual swfEdit control where a tech enters an auto VIN number. These numbers describe the auto, so you can enter partial numbers and do some testing. But the control maintains ? chars in portions of the VIN not entered, and when you manually put the cursor in the field it "jumps" the cursor to the first ? mark.

    It is frustrating and difficult to use interactively, but thats the way it is designed.

    Anyway, if you clear the VIN out, such that there is all ? marks and then type from the start slowly (fast for humans, very slow for automation tools) you are able to manually specify an entire VIN before leaving the field.

    Now to my problem with QTP, when I use the QTP .Type method it types so fast that the app can't do its processing on the first part of the VIN number (it determines Year, Make, etc. as you type--and is going to a local DB), before QTP completes the "blind" typing. So I end up with only a partial VIN being defined.

    My need: is there anyway to programmatically control the pace at which chars are typed using the .Type method?

    -Thanks, Terry Horwath

  2. #2

    Re: can .Type method pacing be configured?

    I don't know of any way to manipulate the native .Type function, but you can write your own and override it with RegisterUserFunc.

    Not quite the elegant solution, but it goes something like this:

    The sub recieves The input string, and does something like this (this is the body of the sub):

    'Say QTPObj is the object the sub acts upon
    Dim iWaitTime
    Dim i

    iWaitTime = 1 '(sec. beween letters)
    For i = 1 to Len(sInput)
    QTPObj.Type Mid(sInput,i,1)
    Wait iWaitTime
    'coz we're programmers - not users

  3. #3

    Re: can .Type method pacing be configured?

    Not sure if this will work for you, but just a suggestion -
    using Type in a for loop with some wait.

    For e.g in the VIN ( which as I know, is some 16 or 17 character string) portion - say first 5 characters - "AB123" - can be typed like

    strVinPortion = "AB123"
    for i=1 to len(strVinPortion)
    currentChar = Mid(strVinPortion, i, 1)
    obj.type currentChar


  4. #4

    Re: can .Type method pacing be configured?

    oops, sorry, didn't know Yaron already submitted a similar reply while I was typing my reply.


  5. #5
    SQA Knight
    Join Date
    Jul 1999
    Grand Rapids, MI

    Re: can .Type method pacing be configured?

    Thanks folks. I was hoping to avoid having to write my own func, and I am concerned about the oddness of this field as to attempt to refocus for each char. But I guess that is what I will have to do.

    -Thanks Again, Terry

    P.S. Luckily the approach described above works on this hinky text field. But I would still like to know if anyone knows how to configure pacing for the .Type method. I am (again) surprised that it is either not obvious how this is done, or that it can't be configured (yet another "given" after working with Silk...).



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:51 PM.

Copyright BetaSoft Inc.