Highlighted
guywithquestion Absent Member.
Absent Member.
2902 views

UFT ContentControl Objects & hovering data capture

Hi, I'm trying to automate a check for an application that I do everyday. The check is to hover over 4 buttons, as I hover over each one, it will show either a box containing a green tick with the applications latency to a server it is connected too(a pass for the test is all the boxes being green).

The problem is that I can't capture the boxs that appear when I hover over each button, as when I move the mouse over to them, they dissapear due to the mouse no longer being over the button.

 

I can capture the buttons using the object spy, and they are objects of type "ContentControl".

 

Is there a way I can capture the data provided in the boxes that appear when I hover over these buttons? It would be great if i could get the boxes that appear when I hover over the button into the object repository, as performing the test on them would be qutie easy.

 

Note: I cannot check the data stream that feeds the boxes.

0 Likes
14 Replies
Mihai_Eminescu Super Contributor.
Super Contributor.

Re: UFT ContentControl Objects & hovering data capture

Hello,

 

I think that what you are trying to do would be easier to achieve using descriptive programming, instead of the Object Repository feature.

Descriptive programming along with the inspect element feature of the browser can prove to be very useful in some cases.

The inspect element feature is more helpful than the Object Spy (in this case) because it allow you to see exactly what happens in the html code when you hover over the button : the boxes that appear might be represented by new lines of code that are inserted only when you hover over the button or they might already exist in the code and become visible when performing the same action. In any case you should be able to see the properties of the boxes and then use descriptive programming in UFT to identify them.

 

Hope this helps.

 

 

Accept as solution and give kudos to the author if the information helped you solve your problem.
0 Likes
guywithquestion Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

Hi,

 

I'm afraid I forgot to mention that this is not a browser application.

 

When I am in UFT and record macros it records it as

WpfWindow("appname").WpfObject("objectname"). etc etc

As such I don't have access to an inspect element feature.

0 Likes
Mihai_Eminescu Super Contributor.
Super Contributor.

Re: UFT ContentControl Objects & hovering data capture

I see.

For browser applications there is another way to capture the properties of web elements in these sort of situations. Maybe I should have started with this. Not sure, however, if it will work for your application.

When using the Object Spy hold down the CTRL key, hover over the button until the box appears and then release the CTRL key. The box should remain visible and you will be able to spy its properties.

 

Hope this helps!

 

 

Accept as solution and give kudos to the author if the information helped you solve your problem.
0 Likes
swaroopjoshi Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

Open up the spy, hold the CTRL key and hover on the menu. Then release the CTRL key, you will be able to capture the properties in the spy.


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
0 Likes
guywithquestion Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

Hi,

 

Yes I've tried holding the CTRL button and then trying to spy on the object that appears, but when I move the mouse off the button, the object dissapears still, the problem is it's not a menu, so when you're not hovering over the button the object I want to spy on dissapears instantly.

0 Likes
RajkumarR Outstanding Contributor.
Outstanding Contributor.

Re: UFT ContentControl Objects & hovering data capture

Try this.

Msgbox WpfWindow("Window").WpfObject("Object").Object.Tooltip

_____________________
Rajkumar Rajangam
0 Likes
guywithquestion Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

I tried "Msgbox WpfWindow("Window").WpfObject("Object").Object.Too​ltip" it returned the following error

"The test run cannot continue due to a syntax error.

Invalid Character

Msgbox WpfWindow("Window").WpfObject("Object").Object.Too​ltip"

 

(I provided an image of the only line in the script I ran, and the error box)

 

 

 

 

 

 

0 Likes
RajkumarR Outstanding Contributor.
Outstanding Contributor.

Re: UFT ContentControl Objects & hovering data capture

Check the Syntax from the Design Menu & clear the syntax error.

_____________________
Rajkumar Rajangam
0 Likes
guywithquestion Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

I don't think that statement will ever run, "ToolTip" is not an identification property of the object, nor does it have a proper value in the "Native" Properties tab of when I spy the button -

 

The value it has is "{System.Windows.Controls.ToolTip}"

0 Likes
Maulik_C Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

Try this

Msgbox WpfWindow("Window").WpfObject("Object").getROProperty ("helptext")
0 Likes
guywithquestion Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

There is no property "helptext" - these are the following idendification properties:

 

Class Name - WpfObject

abs_x - 569

abs_y - 595

attached text - *nothing*

canfocus - True

classname - System.Windows.Controls.ContentControl

devname ContentControl

devnamepath ContentControl;;hotButtonsToolbar,ThisWindow;

enabled - True

focused - False

height - 23

helptext - *nothing*

hwnd - 11471820

name - ContentControl

parent text - *nothing*

regexpwndtitle - *appname*

text - ContentControl

visible - True

width - 23

wpfty - object

x - 535

y - 6

0 Likes
Mihai_Eminescu Super Contributor.
Super Contributor.

Re: UFT ContentControl Objects & hovering data capture

Are there a lot of other elements in the screen these buttons are in ?

You could try giving the code below a go. It will get a list of properties (some that you might find helpful) of all the elements located in the window. Run it once without the three lines that fire the "onmouseover" event and once with them. 

If the results are the same it means that the elements exist but they have the 'visible' property set to false (so you could run it again by setting the value of the property to 'False'). If they are different then the second result must have more entries, and the ones that are in addition of the first one must be the ones which you are looking for (and you can start displaying more properties). You could then use descriptive programming to identify them.

Set Obj = WpfWindow("Window")

'Setting.WebPackage("ReplayType") = 2
'WpfWindow("Window").WpfObject("Object").FireEvent("onmouseover")

Set oDesc = Description.Create
'oDesc("visible").value = "False"
'oDesc("visible").value = 0 '- use whichever works (if the results are the same) Set chObj = Obj.ChildObjects(oDesc) For i = 0 To chObj.count - 1 print "=====Element number "&i+1&"======" print chObj(i).getroproperty("micclass")
print chObj(i).getroproperty("classname") print chObj(i).getroproperty("visible")
'print some other useful properties Next
'Setting.WebPackage("ReplayType") = 1
Set oDesc = Nothing Set chObj = Nothing

 

Hope this helps!

 

 

Accept as solution and give kudos to the author if the information helped you solve your problem.
0 Likes
RajkumarR Outstanding Contributor.
Outstanding Contributor.

Re: UFT ContentControl Objects & hovering data capture

Guess the tooltip functionality is implemented differently in your object.

Try this.
Msgbox WpfWindow("Window").WpfObject("Object").Object.ToolTip.Content

You can also use the .NET spy and explore the tooltip object.
_____________________
Rajkumar Rajangam
0 Likes
swaroopjoshi Absent Member.
Absent Member.

Re: UFT ContentControl Objects & hovering data capture

Can you place a screenshot of the object you are trying to capture


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
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.