Highlighted
Absent Member.. Absent Member..
Absent Member..
346 views

SwfToolbar - GetItemProperty

Jump to solution

Recently our software team changed a menubar from WinMenu to SwfToolbar.

 

The WinMenu object has a GetItemProperty method that uses a semicolon-separated path syntax to find button items contained in the dropdown menus and retrieve their properties, e.g.

 

WinMenu("myMenu").GetItemProperty("View;Status Bar","Checked")

 

This is vital for getting the state of checked items in a menu.

 

Unfortunately, the similar method for SwfToolbar does not recognize the same path syntax; it only can find properties of the toolbar itself.  This is in contrast to the Select method which does use the semicolon path.

 

Has anyone found a good workaround for this?

 

Does HP have any plans to address this shortcoming in the Windows Forms object API?

 

(I am using UFT 12.02; our application is using .NET 4.0)

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: SwfToolbar - GetItemProperty

Jump to solution

Andres - we are using UFT 12.02 and .NET 4.0 (which information I added to the bottom of my original post for clarity), so according the support matrix should be fully supported.

 

I think that this may just be something that got overlooked by the support team.   It seemed odd to me that GetItemProperty() worked differently for SwfToolbar, while the Select method worked fine using the "standard" semicolon-path syntax.  Perhaps there are more difficulties in searching SwfToolbar, due to the richness of controls that can be attached to it.  However, this is not insurmountable; I came up with my own routine to recursively search the hierarchy (see separate post on "Searching SwfToolbar") and mimic the desired functionality so I'm sure your own team could incorporate something like that into the API.

 

I think it would be best if you could open a support ticket and get this passed along to the UFT support team.

 

Thanks,

Stan

View solution in original post

0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

Re: SwfToolbar - GetItemProperty

Jump to solution

Hi Stan,

I hope you have a nice day!

 

Regarding the swf/flex objects, remember UFT requires the application under testing be compiled to works sucessfully so it may be related with the lack of recognition in this controls. So you can verify this and some other details listed below with the development team of this applications.

 

Here you can check the procedure to prepare the application:

https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM00339739

 

Here you can review the basic limitations for this technology:

https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM00682014

 

I hope this information was useful for you.

Best Regards,

 

Andrés J. Brenes

HP Software Support.

[If this inormation solves or helps solve your issue, mark the answer as helpful]

 

[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any solution/suggestion posted.]

Andrés J. Brenes
HP Software Support.
[If this information solves or helps solve your issue, mark the correct one with "Accept as solution" or as "helpful"]
 
[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.
No warranties express or implied for any solution/suggestion posted.]
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: SwfToolbar - GetItemProperty

Jump to solution

Andrés,

 

Thank you for your reply, however you misunderstand me.  This is a problem with the UFT SwfToolbar API, not a problem with object recognition.  Also, SwfToolbar is a .NET Windows Forms component, not Adobe Flex.

 

The SwfToolbar.GetItemProperty(Item,Property) method will not accept a semicolon-separated path string as the Item parameter; it gives an error if you call it with one.

 

SwfToolbar.Select will accept a semicolon-separated path to the button you wish to select, so:

 

SwfToolbar("myMenu").Select "View;Status Bar" will select a Status Bar button located under the View menu.

SwfToolbar("myMenu").GetItemProperty("View;Status Bar","Checked") will give an error rather than find the checkbox state of the Status Bar button.

 

Best regards,

Stan

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: SwfToolbar - GetItemProperty

Jump to solution

Hi Stan,

I hope you have a nice day!

 

 

Ok, thanks for the clarification!

Actually there are similar controls named as swf in adoble flex and also in .net so commonly flex are the complex ones to work.


Once you confirmed the versions and the controls are supported and should be able to work as expected, listed here:
- Available support for .net controls:
https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM196013

 

There is a limitation specifically for the text property so you can verify with the GetItem instead of GetItemProperty to confirm if can make any difference

 

You can review this and more specific details in the Help Guide, it can be found in
UFT ˃ Help ˃ HP Unified Functional Testing Help

 

If even this is not helpful the suggestion will be contact HP Support to create a ticket and receive the accurate support assitance about this issue.

I hope this can be useful

Best Regards,

 

Andrés J. Brenes

HP Software Support.

[If this inormation solves or helps solve your issue, mark the answer as helpful]

 

[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any solution/suggestion posted.]

 

Andrés J. Brenes
HP Software Support.
[If this information solves or helps solve your issue, mark the correct one with "Accept as solution" or as "helpful"]
 
[Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.
No warranties express or implied for any solution/suggestion posted.]
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: SwfToolbar - GetItemProperty

Jump to solution

Hi stan

 

 

you can get status of the toolbar item using .net object Spy 

 

using .net object spy on the toolbar, and try to search for the required property value in property window. It will be definitely present. 

 

once you get the property name,

 

you can get value like below

 

status= swftoolbar.object.Item(1).checked  '''this is not the exact code. it will be similar

 

if you want i can help you here..

 

////Kiran////

If you find this useful, mark Kudos.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: SwfToolbar - GetItemProperty

Jump to solution

Andres - we are using UFT 12.02 and .NET 4.0 (which information I added to the bottom of my original post for clarity), so according the support matrix should be fully supported.

 

I think that this may just be something that got overlooked by the support team.   It seemed odd to me that GetItemProperty() worked differently for SwfToolbar, while the Select method worked fine using the "standard" semicolon-path syntax.  Perhaps there are more difficulties in searching SwfToolbar, due to the richness of controls that can be attached to it.  However, this is not insurmountable; I came up with my own routine to recursively search the hierarchy (see separate post on "Searching SwfToolbar") and mimic the desired functionality so I'm sure your own team could incorporate something like that into the API.

 

I think it would be best if you could open a support ticket and get this passed along to the UFT support team.

 

Thanks,

Stan

View solution in original post

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: SwfToolbar - GetItemProperty

Jump to solution

Kiran,

 

Yes thank you I discovered something like your suggestion on my own.

 

Separately, I have posted a recursive routine I wrote that searches the hierarchy and uses a semicolon-separated path syntax similar to most of the GetItemProperty() methods.   With my routine you do not need to hard-code the entire object path down to the desired object into your code.

 

Stan

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.