We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

UITechnologyElement.GetNativeControlType Method

Returns the native control type of this element.

Namespace:  Microsoft.VisualStudio.TestTools.UITest.Extension
Assembly:  Microsoft.VisualStudio.TestTools.UITest.Extension (in Microsoft.VisualStudio.TestTools.UITest.Extension.dll)

public abstract Object GetNativeControlType(
	NativeControlTypeKind nativeControlTypeKind


Type: Microsoft.VisualStudio.TestTools.UITest.Extension.NativeControlTypeKind
A member of the NativeControlTypeKind enumeration.

Return Value

Type: System.Object
If supported, the native type of the control; otherwise, null.



This GetNativeControlType method can be used in tandem with the universal type that is obtained by using the ControlTypeName when just the ControlTypeName is not enough to differentiate a control. For example, if the native technology is HTML, this method could return the tag name.