QTP Tutorial for Moving mouse to a particular object

Discussion in 'Programming' started by ExpertQTP, Oct 21, 2009.

  1. #1
    Sometimes its required to place your mouse cursor on an object in your application and then perform some operation like clicking that object or even right clicking. I have created a short QTP tutorial for moving your mouse cursor on any object in your application.

    I used Google webpage to create this small tutorial on HP Quicktest Professional. This script will hover over the mouse cursor inside the search box.(It will not click inside the search box, it will simply bring the mouse over the search box)

    The QTP Script goes here:

    x=Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("name:=q").GetROProperty("abs_x")
    y=Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("name:=q").GetROProperty("abs_y")
    Set obj=CreateObject("Mercury.DeviceReplay")
    obj.MouseMove x,y

    For an explanation of the above code, you can read the complete article at QTP Tutorials
     
    ExpertQTP, Oct 21, 2009 IP