qtphp-uftuft14

How to click 'SwfObject' using UFT?


enter image description here

I want to click on a link [Link name is 'Settlement'] and there are number of links on that page.

NOTE: Object spy does not identify 'Settlement' as the link instead it consider as Explorer Bar. When I take object spy on 'Settlement' text it highlights entire Explorer Bar due to which I am not able to get 'Settlement' specific properties. [refer attached screen shot. Due to security reason, I cannot upload a real screen shot].

Through recording, I am able to click 'Settlement' link

SwfWindow("Platform Integration Exchange").SwfObject("mainExplorerBar").Click 133,598

Currently, 133 & 598 are hard coded value for 'Settlement' but in future 'Settlement' position may change.

So I want to know, How can I click a 'settlement' link using X & Y co-ordinate where Object spy is not able to identify 'Settlement' link separately?.

OR is there any other way to click these type of objects?

Thanks Onkar


Solution

  • In such case I would recommend using a virtual button object.

    In your UFT, go to:

    Tools > Virtual Object > New Virtual Object

    Choose "Button" and click "Mark Object" Button. A cross hair cursor would appear and mark the object that you would like to map. Choose the area in the coorrdinates you would like to click.

    When you are done, click "Next".

    Select the parent of the Virtual object and click "Next".

    Name the button, for example, "myButton", and name the collection in which you would like to store the virtual object and click "Finish".

    You can now use the"myButton" button in your script:

    SwfWindow("Platform Integration Exchange").VirtualButton("myButton").Click