SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Oct 1999
    Location
    Germany
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    QTP 8.2: Click to an unknown window at screen-coordinates?

    Hi there,

    I try to find a solution to release a location-specific "click" to a desktop with unknown windows. Even if there is an application at the specified location, the click should happen. I mean something like "Screen.Click 400,500". I tried already like "window("Text:=.*").Click 400,500" but I got only the "window not unique" error message. And analog recording is not what I'm looking for - the coordinates are dynamic and I'd like to change them at run-time of my tests. At another tool I used the "Desktop" as object, but at QTP I cannot find something similar. Thanks in advance for any ideas or solutions.
    Bjoern

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP 8.2: Click to an unknown window at screen-coordinates?

    Bjoern what's the object that you are trying to click?

    Mark Smith.

  3. #3
    Junior Member
    Join Date
    Oct 1999
    Location
    Germany
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP 8.2: Click to an unknown window at screen-coordinates?

    Hi Mark,

    It is an online learning system, which shows its active areas sometimes inside of the background picture, sometimes on any application on desktop. So there is no window object to use. It is known (at runtime), where the item appears, but I do not know which application or window will be in front at this position.
    Thanks for help.

    Bjoern

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    210
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP 8.2: Click to an unknown window at screen-coordinates?

    Hi Bjoern,
    Try using DeviceRepay object.

    Set dr = CreateObject("Mercury.DeviceReplay")
    dr.MouseClick 400, 500, 0

    More details about how to use DeviceReplay here:
    http://kb-web.mercury.com/top5/kblin...11;Product=AQT

    Thanks,
    -Dima
    -Dima

  5. #5
    Senior Member
    Join Date
    Jun 2004
    Location
    Miami,FL
    Posts
    949
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP 8.2: Click to an unknown window at screen-coordinates?

    Bjoern if you don't have access to Mercury site here below how to use the DeviceReplay I copied it from the Mercury site.

    Problem Description: How to use the Device Replay feature
    Solution: Using Device Replay

    The Device Replay feature is used to perform mouse and keyboard actions against screen coordnates that are provided. The Device Replay functions are not automatically recorded, but must be programmed manually in the Expert View.

    Note:
    As this is an undocumented feature, you should be aware that there is no guarantee that it will exist or function the same way in future releases of QuickTest Professional.

    1. Create the Device Replay Object.

    Example:
    Set DeviceReplay = CreateObject("Mercury.DeviceReplay")

    2. Call the desired Device Replay function.

    Example:
    DeviceReplay.SendString("Hello, World")

    The functions that can be used with the Device Replay object are (all coodinates are relative to the top left corner of the screen):

    Function Description
    MouseMove x, y Move the mouse to the screen coordinate (x,y).
    MouseClick x, y, button Move the mouse to the screen coordinate (x,y) and click the button
    (0=left; 1=middle; 2=right).
    MouseDblClick x, y, button Move the mouse to the screen coordinate (x,y) and double-click the button
    (0=left; 1=middle; 2=right).
    DragAndDrop x, y, dropx, dropy, button Drag the mouse from screen coordinate (x,y) to (dropx,dropy) with the button
    (0=left; 1=middle; 2=right) pressed.
    PressKey key Press a key using the ASCII code of the key.
    For example, Chr(13), vbCR and vbTab.
    MouseDown x, y, button Press the mouse button on screen coordinate (x,y).
    MouseUp x, y, button Release the mouse button on screen coordinate (x,y).
    KeyDown key Press a key using the ASCII code of the key.
    For example, Chr(13), vbCR and vbTab.
    KeyUp key Release a key using the ASCII code of the key.
    For example, Chr(13), vbCR and vbTab.
    SendString string Type a string
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".

  6. #6
    Junior Member
    Join Date
    Oct 1999
    Location
    Germany
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP 8.2: Click to an unknown window at screen-coordinates?

    Hi @all,

    the DeviceReplay solves the problem. Big thanks!

    Bjoern

 

 

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.71%
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 12:36 PM.

Copyright BetaSoft Inc.