Highlighted
Absent Member.
Absent Member.
2636 views

UFT is identifying Hidden Objects

Hi Everyone,

 

My application is a windows based application (Infragistics Suport). In my application, some of the objects are hidden (not visible to naked eyes). For example,  we have swfcheckbox which is visble to naked eyes, but while we take the child objects it is showing 5. There is no property to identify the particular object as unique.  "Visible" property - QTP shows that "visible = True".  I tried height, width everything. All are same I've also tried many more methods, but in vain.
"Highlight" button in Object Repository takes me to the application even though object not visible in the application. But it displaying an error message stating "Object Not Visible"
If anybody has any solution, please share.

0 Likes
10 Replies
Highlighted
New Member.

Re: UFT is identifying Hidden Objects

Could you post the object spy screenshot with all properties.

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.
Test Automation Ecstasy
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

Yes, UFT will identify all including hidden objects also.

 

You can see those Hidden objects in ".NET object Spy"(in Toola--> .NET windows forms Object Spy).

 

You spy on it using that tool. you will be able to see all hidden objects with properties.

 

You can use those properties using below syntax.

"Swfwindow("win").swfcheckbox("object").object.somepropertyname"

 

 

///Kiran///

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

Hi Kiran,

 

I dont want to use those objects. i want to avoid those objects. Is there any way or settings in UFT to avoid those hidden objects.

 

Thanks in Advance

Gowrishankar

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

Hi Shanmugavel,

 

I have the attached the screen shot of the object spy as per your request.

 

Regards

Gowrishankar

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

You spy on those objects using ".Net Object Spy".

 

Im pretty sure that you will get properties of the objects to identify UNIQUELY.

 

then use those properties in your code.

 

///Kiran///

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

Actually kiran,  i tried almost all the properties in .netspy. but it also not unique. Do u have any idea about the property name which makes these kind of objects unique?

0 Likes
Highlighted
New Member.

Re: UFT is identifying Hidden Objects

I suggest you to write some custom code and handle this if no options work.

 

On Error Resume Next

CheckBox("").Click 'or your operation

If Err.Number = 100 Then  'replace with Error code for "Object Not Visible"

  ''Handle if anything you need

End If

 

'continue from here

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.
Test Automation Ecstasy
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

Hi Shankar, 

 

Definately Unique properties will be there, otherwise AUT will not work as expected.

 

Follow below steps mentioned in attachment

basic idea is, 

1. select the Swfobject just above on it(chekcbox) in .netspy

2. open the collection of items in that swfobject

3. note down the name othe object that you want

4. loop throgh the child object and get the object name for each.

5. if that name macthes with your expected name, the enable/disable it using the code.

 

Sample code

 

Ex Code: this is just sample code to understand

 

Itemcount=Swfobject(“Object”).Controls.Itemcount

ExpectedObject=”YourObjectName”

For i=0 to Itemcount

  someObject=Swfobject(“Object”).Controls.Item(i).Name

  if ExpectedObject= someObject

       Swfobject(“Object”).Controls.Item(i).Checked= True

       Exit For

  End if

Next

 

 

 

///Kiran///

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: UFT is identifying Hidden Objects

Shanmugavel,

 

I have already tried the solution given by you. For selecting a checkbox it will work. But before selecting i need to take the checked property whether it already got selected or not. In that case it will be a problem right?

0 Likes
Highlighted
New Member.

Re: UFT is identifying Hidden Objects

I believe you can try like this, not sure if its the solution you are expecting.

 

On Error Resume Next

CheckBox("").Click 'To trigger the error

If Err.Number = 100 Then  'replace with exact Error code for "Object Not Visible" error

  'Do nothing - because this is not the CheckBox you are expecting

ElseIf objCheckBox.Exist AND objCheckBox.GetROProperty("Visible") Then

  'This is the CheckBox you are expecting

 

   'You can use CHECKED property to retrieve the value

   If objCheckBox.GetROProperty("checked") Then

     'Do you operations based on the expected simulation to be done

   End If

End If

 

If above not works, you can try Visual Relation also.

1. Create a TO for frame window displaying right side for the option selected on the left side tree view

2. Create a TO for the checkbox

3. Assign the Frame TO as a relation to the CheckBox TO (Above + In Line Vertically + Closest on Y axis)

 

Give a try wth these options. 🙂 

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.
Test Automation Ecstasy
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.