SPONSORS:






User Tag List

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

    Selecting items from a right click menu

    I apologize in advance as I've just started using QTP. Can anyone help me in getting the selecting of an item from a right click menu to work? A "clear.cache" appears when I click on a any item from a right click menu.

    Browser("Login").Page("App 3.0_2").WebElement("Search").Click
    Browser("Login").Page("App 3.0_4").WebElement("0022").FireEvent "oncontextmenu"
    Browser("Login").Page("App 3.0_4").WebElement("clear.cache").Click

  2. #2
    Junior Member
    Join Date
    Oct 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    Actually I just realized its because the right-click function is not pulling up the contextmenu. Does anyone have any suggestions?

    Browser("Login").Page("App 3.0").WebElement("00020").FireEvent("contextmenu" )

  3. #3
    Member
    Join Date
    Sep 2010
    Location
    TN, India
    Posts
    377
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    Try this.
    <font class="small">Code:</font><hr /><pre>Browser("Login").Page("App 3.0").WebElement("00020").RightClick</pre><hr />

    Thanks...
    Thank/Like to help others if my input helped you !!!
    I am speaking for myself, not for my employer nor any one.
    Automation Ecstasy

  4. #4
    Junior Member
    Join Date
    Oct 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    Neither of those options seems to work since nothing happens.

    Browser("Login").Page("App 3.0_4").WebElement("0022").FireEvent "oncontextmenu"

    Browser("Login").Page("App 3.0").WebElement("00020").RightClick

    Thanks.

  5. #5
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    try this and let me know if it works...

    Dim oDR
    Set oDR=CreateObject("Mercury.DeviceReplay")
    Set obj=Browser("Login").Page("App 3.0").WebElement("00020")
    obj.click
    wait 3
    x1=obj.GetroProperty("x")
    y1=obj.GetroProperty("y")
    oDR.MouseClick x1,y1,2

  6. #6
    Junior Member
    Join Date
    Oct 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    Thanks John.

    For some reason -- oDR.MouseClick x1,y1,2 -- does not click the actual object instead its clicking the upper left corner of QTP. I'm assuming its not able to find the coordinates of the object.

    If it helps the application I am using is a java(gwt) based web app.

  7. #7
    Junior Member
    Join Date
    Oct 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    Ah so I somewhat figured it out. I've added the x and y coordinates to the object in OR. However when I do this and execute the script - QTP is unable to find the obj

    "Cannot identify the object "00020" (of class WebElement). Verify that this object's properties match an object currently displayed in your application.
    Line (13): "obj.Click"."

    When I remove the x,y properties the script runs fine but since i don't have an x,y i'm back to where i was before. where x and y = 0

  8. #8
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    try now..

    Dim oDR
    Set oDR=CreateObject("Mercury.DeviceReplay")
    Set obj=Browser("Login").Page("App 3.0").WebElement("00020")
    obj.click
    wait 3
    x1=obj.GetroProperty("x")+10
    y1=obj.GetroProperty("y")+10
    oDR.MouseClick x1,y1,2

  9. #9
    Junior Member
    Join Date
    Oct 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting items from a right click menu

    I kind of get it now. Please correct me if I'm wrong. Since I am testing a web app on IE, QTP DOES NOT factor in the IE tool bars menu and etc. So the cord. 0,0 is only valid for my application if I am running IE in full screen mode. So since I'm not running in FullScreen mode I need to compensate for the IE toolbars thus offsetting what QTP shows as the X,Y cord. (187,183) to (187, 316).

    So then for those testing apps in browsers - are they always testing their apps in full screen mode? or compensating like i have to?

    Thanks for your help John.

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

    Re: Selecting items from a right click menu


 

 
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 12:31 AM.

Copyright BetaSoft Inc.