QTP is unable to retirieve the "Class Name" of the SilverLight objects. (304 Views)
Reply
Occasional Advisor
NaveenVanapalli
Posts: 9
Registered: ‎12-04-2013
Message 1 of 8 (304 Views)
Accepted Solution

QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello,

 

QTP is unable to get the "Class Name" of any SilverLight objects like Web objects. Below is the example statement

 

rcClass = Browser("Browser").Page("Page").SlvWindow("SlvWindow").SlvObject("SlvObject").SlvEdit("SlvEdit").GetROProperty("micClass")

Msgbox rcClass

 

Expected value -- "SlvEdit"

Actual Value -- retreiving the value of the propety named "slvtypename"

 

Please use plain text.
HP Expert
Ana_Noncheva
Posts: 228
Registered: ‎08-06-2013
Message 2 of 8 (282 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello,

 

What if you use GetTOProperty instead?

Or, use "Class Name" property instead of "micClass"?

Also, is this behavior observed with this SlvEdit control only?

 

Regards,

Ana

 

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Please use plain text.
Occasional Advisor
NaveenVanapalli
Posts: 9
Registered: ‎12-04-2013
Message 3 of 8 (278 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello Ana,

 

Thanks for the reply.

 

Please see the answers in bold italic  font for the questions that you have asked in your reply.

I just copied those into this post

 

What if you use GetTOProperty instead? Using this method it is returning the "Class Name" value of the object as SlvEdit, SlvButton, etc., but this is the value which come from OR but not from the AUT right.

Actually i am using descriptive programming instead of OR.

 

Or, use "Class Name" property instead of "micClass"? I have used this too i.e., SlvObject.GetROProperty("Class Name") where it is returnign the value of the property named "classname" but not the actual "Class Name" value what we have seen from the object spy.

 

Also, is this behavior observed with this SlvEdit control only? NO, observed for all Slv objects ex: SlvExpander, SlvCheckBox, SlvRadioButton, etc.,

 

Thanks,

Naveen

Please use plain text.
HP Expert
Ana_Noncheva
Posts: 228
Registered: ‎08-06-2013
Message 4 of 8 (265 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello,

 

Well, micClass is the Test Object's class actually, i.e. given(defined) by QTP not by the AUT. Moreover, it is not expected to change during run-time. So you should use GetTOProperty and SetTOProperty here.

 

Regarding descriptive programming note, I would suggest you better use Description object instead, as in below example (from QTP/UFT help):

 

'Create a description object to help retrieve all WebEdit objects in a specific page.
Set oDesc = Description.Create()
    oDesc("micclass").Value = "WebEdit"
    oDesc("name").Value = "credit_card_number"

'Retrieve all WebEdit objects in this page
Set EditCollection = Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").ChildObjects(oDesc)

NumberOfEdits = EditCollection.Count

'Search for a specific WebEdit object and set its value
For i = 0 To NumberOfEdits - 1
    If EditCollection(i).GetROProperty("name") = EditToSearch Then
       EditCollection(i).Set ValueToSet
    End If
Next

 

 

More information about the Description oject you can find in QTP/UFT help.

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Please use plain text.
Occasional Advisor
NaveenVanapalli
Posts: 9
Registered: ‎12-04-2013
Message 5 of 8 (259 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello,

 

Thanks a lot for your valuable comments Ana.

 

One last question Ana --

when QTP is able to retrieve the Test object's class of any object (i.e., either Web version or .NET version of objects) using GetROProperty("micClass") then why not for Silver Light object using GetROProperty("micClass")?

 

Regards,

Naveen

Please use plain text.
HP Expert
Ana_Noncheva
Posts: 228
Registered: ‎08-06-2013
Message 6 of 8 (200 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

[ Edited ]

Hello Naveen,

 

You are right, I tested this with UFT 11.53 and behavior is the same as you describe, but not only with Slv objects: I also observed this with JQuery objects for example.

However, I cannot tell why this is happening exactly as it is about internal implementation of Slv support of QTP/UFT.

 

Please note that the Description object suggestion is also taking the RO property value, which is the incorrect one for Slv objects: i.e. for oDesc("micclass").Value = ".." in above example you should use the slvtypename property value for a Slv object.

 

So you should log a case for this, so that defect or ER is created (on top of UFT 11.53, for sure).

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Please use plain text.
Occasional Advisor
NaveenVanapalli
Posts: 9
Registered: ‎12-04-2013
Message 7 of 8 (190 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello Ana,

 

Could you please let me know how could I log a ticked regarding this micClass issue for SlvObjects?

 

Thanks,

Naveen

Please use plain text.
HP Expert
Ana_Noncheva
Posts: 228
Registered: ‎08-06-2013
Message 8 of 8 (187 Views)

Re: QTP is unable to retirieve the "Class Name" of the SilverLight objects.

Hello Naveen,

 

Please use following link: http://support.openview.hp.com/casemanager/incident-index

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation