Topic
  • 8 replies
  • Latest Post - ‏2013-06-18T07:47:22Z by ChrisGF
Sathish804
Sathish804
1432 Posts

Pinned topic How to Right Click on the Screen in RFT Java Script?

‏2009-08-05T10:26:44Z |
Hi All,

I want to know how to Right Click on the Screen in Script using RFT.
Thanks in Advance...
Sathish.
Updated on 2011-04-02T13:42:20Z at 2011-04-02T13:42:20Z by fume
  • SystemAdmin
    SystemAdmin
    16727 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2009-08-05T11:02:12Z  
    Hi,

    Did you tried using the button(for Right click menu)? This button is available in all standard key boards.
    Next to windows button...

    Regards,
    Prakash.
  • Sathish804
    Sathish804
    1432 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2009-08-05T11:26:45Z  
    Hi,

    Did you tried using the button(for Right click menu)? This button is available in all standard key boards.
    Next to windows button...

    Regards,
    Prakash.
    Thanks for Reply.
    I have achived Right click by calling

    object.click(RIGHT);
    


    Now i have a new problem with the Right click menu,I am not able to find the RC menu using find method.When i have mapped the Right click menu i got only 1 property

    .class = Html.NoOpTopWindow
    

    i have written my code some thing like this to find the RC menu after displaying RC menu i have called find method on root test object to find the RC menu object

    TestObject[] to = getRootTestObject().find(
                                    atDescendant(".class", "Html.NoOpTopWindow"));
     
                    System.out.println(to.length);
    

    Everytime my Sysout is giving '0'.i.e it is not finding the Object.Please find the attached doc for screen shots.

    Any suggestions are most welcome...
    Thanks in advance..
    Sathish

    Attachments

    Updated on 2014-03-25T18:37:22Z at 2014-03-25T18:37:22Z by iron-man
  • fume
    fume
    2 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2011-03-30T19:48:46Z  
    Thanks for Reply.
    I have achived Right click by calling

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">object.click(RIGHT); </pre>

    Now i have a new problem with the Right click menu,I am not able to find the RC menu using find method.When i have mapped the Right click menu i got only 1 property

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">.class = Html.NoOpTopWindow </pre>
    i have written my code some thing like this to find the RC menu after displaying RC menu i have called find method on root test object to find the RC menu object

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">TestObject[] to = getRootTestObject().find( atDescendant(".class", "Html.NoOpTopWindow")); System.out.println(to.length); </pre>
    Everytime my Sysout is giving '0'.i.e it is not finding the Object.Please find the attached doc for screen shots.

    Any suggestions are most welcome...
    Thanks in advance..
    Sathish
    Hi,

    Do you have a solution for this problem? I have the same value for my right click menu and want to click on menu item. If you found a solution, can you please share with me.

    thanks,
  • Sathish804
    Sathish804
    1432 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2011-03-31T05:18:10Z  
    • fume
    • ‏2011-03-30T19:48:46Z
    Hi,

    Do you have a solution for this problem? I have the same value for my right click menu and want to click on menu item. If you found a solution, can you please share with me.

    thanks,
    Hi,

    I have used inputKeys method to navigate in the Right click menu...
  • fume
    fume
    2 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2011-04-02T13:42:20Z  
    Hi,

    I have used inputKeys method to navigate in the Right click menu...
    Thanks Sathish! It is not reliable enough but it seems the only way to handle.
  • Krisz
    Krisz
    2 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2013-05-16T11:26:20Z  
    • fume
    • ‏2011-04-02T13:42:20Z
    Thanks Sathish! It is not reliable enough but it seems the only way to handle.

    Hi!

    I used the same solution (inputKeys) but some items in the right click menu do not have a short key.

    In this case what can I do?

  • Sathish804
    Sathish804
    1432 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2013-05-17T11:19:21Z  
    • Krisz
    • ‏2013-05-16T11:26:20Z

    Hi!

    I used the same solution (inputKeys) but some items in the right click menu do not have a short key.

    In this case what can I do?

    Hi Krisz,

    Idea is simple.. calculate the number of down keys needed to navigate on to each menu item and call inputkeys for those many times.

    After your control moved on to that menu item again use inputkeys to press Enter so that menu item selection will happen.

    Thanks and Regards,

    Sathish.

  • ChrisGF
    ChrisGF
    191 Posts

    Re: How to Right Click on the Screen in RFT Java Script?

    ‏2013-06-18T07:47:22Z  

    Hi Krisz,

    Idea is simple.. calculate the number of down keys needed to navigate on to each menu item and call inputkeys for those many times.

    After your control moved on to that menu item again use inputkeys to press Enter so that menu item selection will happen.

    Thanks and Regards,

    Sathish.

    Thanks Sathish!