SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2006
    Location
    Canberra
    Posts
    206
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    GetTextLocation Question (File Button)

    Hi Guys,

    I'm trying to use the GetTextLocation to click on the File menu of a windows app. QTP is only recoginsing the window and not the individial menu items as separate objects so I figured this would be the best way. The other option would be to use something like below

    Window("Main Window").Type micAltDwn + "f" + micAltUp

    It's a pretty standard button seen on most applications. Press the File button and you get a dropdown list with options like Print, Exit, save, etc

    When I use Window("Main Window").GetVisibleText
    I cannot see the File menu or any other button in the top menu.
    Doe's this maen that GetTextLocation will not be able to find the button. I was hoping to be able to return the coordinates of the file button then click on it

    Any feedback on what I'm trying to do would be appreaciated or if anyone has a better way to find and select these kind of buttons

    Thanks

    Gavin

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

    Re: GetTextLocation Question (File Button)

    For a menu item, you will need to add the menu object and navigate to the required path by using the select method along with the path to navigate - you could do a simple recoding with Notepad for any menu item, that should help you.

  3. #3
    Advanced Member venu.adhikesevan's Avatar
    Join Date
    Jun 2010
    Posts
    517
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: GetTextLocation Question (File Button)

    Hope this code will help,

    Window("Main Window").highlight
    set WshShell = CreateObject("WScript.Shell")
    WshShell.Sendkeys "%f" '% --- for Alt + F
    Set WshShell = Nothing

    Cheers.....
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

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

    Re: GetTextLocation Question (File Button)

    You may also want to look at the help on GetTextLocation as even if it did recognize the menu bar it wouldn't work as you expect.

    It doesn't return coordinates as you might expect by its name. Rather you supply the text string and coordinates and it returns a true/false as to whether it found it in those coordinates.

 

 

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 03:32 AM.

Copyright BetaSoft Inc.