Trusted Contributor.
Trusted Contributor.

No micclass property and inconsistent return values when addins are loaded for nativeclass, class n

When I run below code (UFT 14) I have some weird  behavior and output

  • No output for micclass (with and without addins loaded).
    Which property should I use that exist for all objects also when addins are added to determine the basic class?
  • Without any addins loaded I get different result compared to when I start loading addins (UIAutomation and Web)
  • Without addins I have nativeClass property and when loading addings I suddenly only have class name
  • When IUIAutomation addin loaded HP UFT breaks with unexpected error and I have to restart HP UFT
  • Which property related to a class is allways there for any recognized child object to base decision(s) on?
    I was surprised to not have micclass where I thought it would allways be there when you want to get the existing  RO properties from the registry I need to get class for _Test_Object_
    HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest\Test Objects\_Test_Object_\Properties
  • I gets slow when UIAutomation addin is loaded. Why?


Call ex_desktopWalker()
Function getProperty(obj,strPropName)
tVal= obj.GetRoProperty(strPropName)
If tval<>"" Then
	tval= strPropName & ":=" & tval
End If
End Function
Sub ex_desktopWalker()
	Set oDescription = Description.Create  ' All objects
	'oDescription( "micclass").Value = "Window"
	Set myDesktop=Desktop
	Set myChilds=myDesktop.childobjects(oDescription)
	print "Desktop elements " & myChildCount
	For i = 1 To myChildCount -1 Step 1
'	For i = 1 To 15 Step 1
		Set myElement=myChilds(i)
		On error resume next
		tInfo=tInfo & getproperty(myelement,"nativeClass") & vbtab
		tInfo=tInfo & getproperty(myelement,"native_class") & vbtab
		tInfo=tInfo & getproperty(myelement,"micclass") & vbtab
		tInfo=tInfo & getproperty(myelement,"micClass") & vbtab		
		tInfo=getproperty(myelement,"class") & vbtab
		tInfo=tInfo & getproperty(myelement,"class name") & vbtab
		tInfo=tInfo & getproperty(myelement,"regexpwndclass") & vbtab
		tInfo=tInfo & getproperty(myelement,"visible") & vbtab
		tInfo=tInfo & getproperty(myelement,"hwnd") & vbtab
		tInfo=tInfo & getproperty(myelement,"text") & vbtab
		tInfo=tInfo & getproperty(myelement,"name") & vbtab
		tInfo=tInfo & getproperty(myelement,"va_name") & vbtab
		tInfo=tInfo & getproperty(myelement,"regexpwndtitle") & vbtab
		tInfo=tInfo & getproperty(myelement,"Value") & vbtab

		tVisible= myElement.getroproperty("visible") 
'		If tvisible=true  Then		
'			myElement.activate
'			myelement.highlight
'			myelement.capturebitmap "D:\" & i & ".png",true
'		end if
		If err.number <> 0 Then
			print i & "error on " & tInfo 
			print i & "passed " & tInfo
		End If
		On error goto 0
	set mychilds=nothing
	Set mydesktop=nothing
End Sub
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.