SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Type Method doesn\'t seem to work in TE

    hi,
    I have got QTP 9.5 with terminal emulator add in.I have used the type method of setting the value to a feild in telnet application(VT 100) connected via host explorer. Problem is that type method offen misses to set the value. (In below function "Type micCtrlDwn + "D" ) QTP continue to execute the next statements ..which cause a lot of problems ..

    TeWindow("TeWindow").TeTextScreen("TeTextScreen"). Sync 5000
    TeWindow("TeWindow").TeTextScreen("TeTextScreen"). Type micCtrlDwn + "D"
    ' TeWindow("TeWindow").TeTextScreen("TeTextScreen"). Sync 5000
    TeWindow("TeWindow").TeTextScreen("TeTextScreen"). Type micLCtrlUp
    TeWindow("TeWindow").TeTextScreen("TeTextScreen"). Sync 5000

  2. #2
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,557
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    Try using SendKeys. I have the same problem with acxtables and even vbedits in my app. .Type works...most of the time, but I've found I can't rely on it. Actually created an "EnterData" function that I can pass the type of object to populate and the value to enter and do all my special handling there.

  3. #3
    Member
    Join Date
    Aug 2006
    Location
    chennai
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    Try this

    TeWindow("TeWindow").TeTextScreen("TeTextScreen"). Type micCtrlDwn + "d" + micCtrlUp
    Thanks.

  4. #4
    Junior Member
    Join Date
    Jun 2008
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    hi ,
    I tried using that before ... still i face the problem of statement not getting execute attimes .. QTP just goes to the next step ... i like to add that this code works perfectly when we debug it ..

  5. #5
    Junior Member
    Join Date
    Jun 2008
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    i couldn't use the senkeys for micCtrlDwn + "D"+micCtrlUp (for Page Down)QTP tries to put it as text not as control key. this code run perfectly when we run in debug and type is executed every time

  6. #6
    Member
    Join Date
    May 2004
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    This should work.

    Function TEType (obj, myString)
    ''Access the parent object of the TeTextScreen, used to set focus to TE Window
    Set WinObj = obj.GetTOProperty("parent")

    ''Create object for SendKeys method
    Set WshShell = CreateObject("WScript.Shell")
    WinObj.Activate

    Select Case myString
    Case micF1 WshShell.SendKeys "{F1}"
    Case micF2 WshShell.SendKeys "{F2}"
    Case micF3 WshShell.SendKeys "{F3}"
    Case micF4 WshShell.SendKeys "{F4}"
    Case micF5 WshShell.SendKeys "{F5}"
    Case micF6 WshShell.SendKeys "{F6}"
    Case micF7 WshShell.SendKeys "{F7}"
    Case micF8 WshShell.SendKeys "{F8}"
    Case micF9 WshShell.SendKeys "{F9}"
    Case micF10 WshShell.SendKeys "{F10}"
    Case micF11 WshShell.SendKeys "{F11}"
    Case micF12 WshShell.SendKeys "{F12}"
    Case SF1 WshShell.SendKeys "+{F1}"
    Case SF2 WshShell.SendKeys "+{F2}"
    Case SF3 WshShell.SendKeys "+{F3}"
    Case SF4 WshShell.SendKeys "+{F4}"
    Case SF5 WshShell.SendKeys "+{F5}"
    Case SF6 WshShell.SendKeys "+{F6}"
    Case SF7 WshShell.SendKeys "+{F7}"
    Case SF8 WshShell.SendKeys "+{F8}"
    Case SF9 WshShell.SendKeys "+{F9}"
    Case SF10 WshShell.SendKeys "+{F10}"
    Case SF11 WshShell.SendKeys "+{F11}"
    Case SF12 WshShell.SendKeys "+{F12}"
    Case "SF1" WshShell.SendKeys "+{F1}"
    Case "SF2" WshShell.SendKeys "+{F2}"
    Case "SF3" WshShell.SendKeys "+{F3}"
    Case "SF4" WshShell.SendKeys "+{F4}"
    Case "SF5" WshShell.SendKeys "+{F5}"
    Case "SF6" WshShell.SendKeys "+{F6}"
    Case "SF7" WshShell.SendKeys "+{F7}"
    Case "SF8" WshShell.SendKeys "+{F8}"
    Case "SF9" WshShell.SendKeys "+{F9}"
    Case "SF10" WshShell.SendKeys "+{F10}"
    Case "SF11" WshShell.SendKeys "+{F11}"
    Case "SF12" WshShell.SendKeys "+{F12}"
    Case "CF1" WshShell.SendKeys "^{F1}"
    Case "CF2" WshShell.SendKeys "^{F2}"
    Case "CF3" WshShell.SendKeys "^{F3}"
    Case "CF4" WshShell.SendKeys "^{F4}"
    Case "CF5" WshShell.SendKeys "^{F5}"
    Case "CF6" WshShell.SendKeys "^{F6}"
    Case CF1 WshShell.SendKeys "^{F1}"
    Case CF2 WshShell.SendKeys "^{F2}"
    Case CF3 WshShell.SendKeys "^{F3}"
    Case CF4 WshShell.SendKeys "^{F4}"
    Case CF5 WshShell.SendKeys "^{F5}"
    Case CF6 WshShell.SendKeys "^{F6}"
    Case micHome WshShell.SendKeys "{HOME}"
    Case micEnd WshShell.SendKeys "{END}"
    Case micBack WshShell.SendKeys "{BACKSPACE}"
    Case micReturn WshShell.SendKeys "{ENTER}"
    Case micTab WshShell.SendKeys "{TAB}"
    Case micDwn WshShell.SendKeys "{DOWN}"
    Case micUp WshShell.SendKeys "{UP}"
    Case micLeft WshShell.SendKeys "{LEFT}"
    Case micRight WshShell.SendKeys "{RIGHT}"
    Case micCtrlDwn + "x" + micCtrlUp WshShell.SendKeys "^x"
    Case micEsc WshShell.SendKeys "{ESC}"
    Case Else WshShell.SendKeys(mystring)
    End Select


    Set WshShell = Nothing
    Set WinObj = Nothing
    End Function


    'This function is to register the function so that it over-writes the standard Type method, how to call the function, and how to unregister the function at the end of your test run
    ''Register the user-defined function so that it over-writes the standard Type method.
    RegisterUserFunc "TeTextScreen", "Type", "TEType"

  7. #7
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,557
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    [ QUOTE ]
    i couldn't use the senkeys for micCtrlDwn + "D"+micCtrlUp (for Page Down)QTP tries to put it as text not as control key. this code run perfectly when we run in debug and type is executed every time

    [/ QUOTE ]

    Sendkeys doesn't recognize the micCtrl commands. Look it up in help for all the keys. Ctrl + D would become SendKeys "^D"

  8. #8
    Junior Member
    Join Date
    Jun 2008
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    Thanks for the reply ..
    But that too .. doesn't work it sends as a text

  9. #9
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,557
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    That's...bizzare. Try running it against something else, even a notepad window to see if it types it there as text? If so, I'd think there's something wrong with your QTP install.

    Dim wshShell
    Set wshShell = CreateObject("WScript.Shell")
    wshShell.SendKeys "^d"

  10. #10
    Junior Member
    Join Date
    Jun 2008
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Method doesn\'t seem to work in TE

    hi ... I donot find problem with sendkeys when using anywhere else....
    to throw some more light ... we tried configuring the Putty emulator and scripting ..there type method works ...but facing another problem when using gettext() method to get text from the screen doesn't return all rows ...but misses alternative row ..

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:52 AM.

Copyright BetaSoft Inc.