Results 1 to 7 of 7
  1. #1

    QTP and UI Automation

    Hello All,
    Our client is using third-party controls that QTP cannot identify (QTP can identify the menus but cannot identify the menu items). I searched the web for ways to combat this issue and found that people were creating their own custom libraries and using that in conjunction with QTP to identify objects.

    I was thinking of creating my own dll that would get a unique identifier of a menu item (such as the name) and get the coordinates of the menu item so that I could pass those coordinates to QTP which could then click the menu item. I am planning on creating my dll in Visual Studio C# 2010 Express.

    So, my question is, would this be a logical way to go about this problem and if so, where would I get started. Or is there a more efficient method? Any responses and comments are greatly appreciated. Thanks in advance! [img]/images/graemlins/smile.gif[/img]

  2. #2

    Re: QTP and UI Automation

    This is a follow up to my previous question. I ended up creating a class library that uses UI Automation that retrieves the name of the element and gets its boundingrectangle property in order to calculate the coordinates of the element. Getting started, I planned what I needed to do and came up with the following steps:

    1 - How to retrieve the element name and its properties
    2 - Calculate the element's coordinates
    3 - Return results

    Using the UI Spy (in Windows SDK) to spy on my elements, I discovered that I had to traverse firstly to the window that held the elements, then to the element's direct parent and finally to the element itself.

    Knowing little about UI Automation, I searched both the web and MSDN and finally found a page pertaining to the RootElement property of the AutomationElement object. From there, I relied heavily on the resources of MSDN and created my library.

    If you are looking for code on how to do this or something similar, I suggest that you look up the AutomationElement.RootElement Property on MSDN or better yet look at their articles regarding UI Automation.

  3. #3

    Re: QTP and UI Automation

    You can use keystrokes automation here using SendKeys(Refer QTP Help).

    Then you need to automate for example:-
    1. Right click (Object.click micRightBtn) or context menu key(shift+F10).
    2. Down Arrow N times
    3. Enter
    Kind regards,
    Anand Tambey

    RSS Feed : Break To Make it Better
    A Lazy person could be the best automation professional, if he is not lazy in implementing his ideas to reduce his work. ~Anand Tambey

  4. #4

    Re: QTP and UI Automation

    I think as anand mentioned one can use the SendKeys method and navigate through the menu items.
    Ganesh Iyer
    Winds of Change

  5. #5

    Re: QTP and UI Automation

    Hi Amor,

    Custom add-ins can be developed in QTP for some environments and its done using Extensibility accelerator.

    Take a look at this video from HP


    This is demo for Web based applications. But this gives a rough idea on how to do it.

  6. #6

    Re: QTP and UI Automation

    Thanks for all of your replies! I'll take a look at the various methods suggested here (keystrokes, sendkeys, etc). I'll also take a look at the custom add-in development as well. Thanks again.

  7. #7

    Re: QTP and UI Automation

    Hi Amor,

    As Raj said QTP's add-in extensibility might serve your problem. I have worked on extending the QTP's functionality in recognizing some of the web controls (using web extensibility mechanism) which QTP fails to identify earlier.Please have a glance at the tutorial for Java add-in development in QTP.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:43 PM.

Copyright BetaSoft Inc.