Hi Lakshmi,

micRightBtn usage given below :

There is an article in the HP QTP knowledge base on this very subject
(#34618). In case you haven't got access to the Knowledge base I have pasted
the article below :

*Problem Description: QuickTest Professional is unable to record on icons
located in the system tray*
QuickTest Professional (QTP) does not generate any code while recording
right-clicking on an icon in the system tray and selecting an item from the
pop-up menu.

*Diagnosis:* By default, QuickTest Professional does not record on the
system tray and pop-up menu's like the one seen for MS Messenger and similar
programs. The reason why QTP does not record on the pop-up menu items is
that the menu's parent window is not visible. By default, QTP records a
command if the object and all its parents are visible. In order to enable
recording on an object with an invisible parent, the parent must have the
"visible" property as one of the mandatory properties.

*Solution: Set the "visible" property to mandatory for the Window object to
record on the icon`s popup menu*
A two step process is involved in order to select an item from a system tray
icon's pop-up menu; open the pop-up menu and select the item from the pop-up
menu. The code to open the pop-up menu (i.e., the right-click on the icon)
needs to manually entered. The code to select an menu item from the pop-up
menu can be recorded, but you will need to modify the Object Identification
Settings for the Windows objects (Window and WinObject in this case) first.

1.      Add the "visible" property to the mandatory list for the Window and
WinObject objects. For information on modifying the mandatory properties,
refer to *Problem ID 30733 - How to modify the recorded properties of an
object or window*. Once the "visible" property has been added, QuickTest
Professional should record selecting the item from the pop-up menu. This
modification will not make QuickTest Professional record the right click on
the system tray icon.

2.      Manually add the code to open the pop-up menu to your script:
3.      Switch to Expert View.

   4.      Copy the following line into the QuickTest Professional script
         where you wish to click on the system tray icon:

1.
Window("regexpwndclass:=Shell_TrayWnd").WinObject("regexpwndclass:=TrayNotifyWnd").WinToolbar("nativeclass:=ToolbarWindow32").Press
"<item name>", micRightBtn

5.      Modify the arguments to the Press method (above) as needed:

   - The first argument needs to match the icon name in the system tray that
                  needs to be selected. The icon name is seen when the
mouse is moved over the
                  icon. Note that the name is case sensitive.
                  - If you need to left-click on the icon, then use
                  micLeftBtn as the second argument in the Press method.
               1. Record selecting the desired menu item from the pop-up
      menu.
         1. Click the Record button.
            2. Right-click on the desired system tray icon to open the
            context menu. (QuickTest Professional will not record this step.)
            3. Select the desired item from the context menu. (QuickTest
            Professional should record this step).
            4. Stop recording.
         1. QuickTest Professional should record a line similar to the
         following:
         2. Window("Y!TrayWnd").WinMenu("ContextMenu").Select "Show Yahoo!
         Messenger"

The final code (with the manually entered line and the recorded menu item
selection) should look similar to the following example:

*Example:*
' Right click on the Yahoo! Messenger icon
Window("regexpwndclass:=Shell_TrayWnd").WinObject("regexpwndclass:=TrayNotifyWnd").WinToolbar("nativeclass:=ToolbarWindow32").Press
"Yahoo! Messenger", micRightBtn

' Select the "Show Yahoo! Messenger" menu item
Window("Y!TrayWnd").WinMenu("ContextMenu").Select "Show Yahoo! Messenger"
*Note:*
The above steps should work with QTP 8.0 and above.


On Mon, Oct 6, 2008 at 4:09 PM, lakshmi jyoshna <[EMAIL PROTECTED]>wrote:

> i think here i have to pass the values for obj ,offset-x and offset_t
>  can you try this code on a word doc and let me know the code for that
> sory dont think otherwise
> i dont have qtp now
> i have to try it in my home thats what iam asking
>
> On Mon, Oct 6, 2008 at 4:01 PM, Srinivas Pavuluru <[EMAIL PROTECTED]>wrote:
>
>>  Hi Lakshmi.
>>
>> I found following code in QTP help, may be this helps to you.. Try and let
>> me know..
>>
>> *Right Click using Device Replay
>> *The function below uses the Device Replay object to perform a right
>> click operation on any object by retrieving the coordinates of the object.
>>
>> Sub RightClickObj(Obj, Offset_x, Offset_y)
>>     x_coord = Obj.GetROProperty("abs_x")
>>     y_coord = Obj.GetROProperty("abs_y")
>>     Set dr = CreateObject("Mercury.DeviceReplay")
>>     dr.MouseClick x_coord + Offset_x, y_coord + Offset_y, 2
>> End Sub
>>
>>
>> --
>> With Regards
>> Srinivas P
>>
>> On Mon, Oct 6, 2008 at 2:50 PM, lakshmi jyoshna <[EMAIL PROTECTED]>wrote:
>>
>>>  for right click micrightbn method is there
>>> but i dont know the syntax properly
>>>
>>>   On Mon, Oct 6, 2008 at 9:32 AM, kool guy <[EMAIL PROTECTED]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I think it's possible to select any  item in toolbar but it's not
>>>> possible for right click.
>>>>
>>>> Srikar
>>>>
>>>>
>>>> On Mon, Oct 6, 2008 at 6:04 AM, lakshmi jyoshna <[EMAIL PROTECTED]
>>>> > wrote:
>>>>
>>>>> no its possible
>>>>>
>>>>>
>>>>> On Sun, Oct 5, 2008 at 10:14 PM, Enock Prince <[EMAIL PROTECTED]>wrote:
>>>>>
>>>>>> Its not possible in VBscript.
>>>>>> Use Mercury.DeviceReplay.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> Enock Prince.G
>>>>>>
>>>>>>   On 10/5/08, lakshmi jyoshna <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>>>   Hai can any one tell me the script to select on a toolbar button
>>>>>>> in any application
>>>>>>> and for rightclick option
>>>>>>>
>>>>>>> --
>>>>>>> Jyoshna
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Jyoshna
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>
>
> --
> Jyoshna
>
> >
>


-- 
Ganesh Muralidharan
Wipro Technologies
Mob. : 9341023574

'God Never Forgets'

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to