ToControl

Return a WinDriver Control object from an AutomationControl.

Control ToControl();

Parameters

None

Remarks

This method returns a WinDriver Control Class object. This can be useful if you wish to use Control class methods that do not have an equivalent in the AutomationControl class.

Not all AutomationControl objects can be converted to a Control object. This will always apply if the AutomationControl does not have a Windows handle (the Element.Current.NativeWindowHandle).  You can check the presence of a Windows handle using a Windows spy tool for Automation Elements.

Example

AutomationControl notepad = FindTopAutomationWindow("notepad");

notepad.ToControl().ShowWindow(ShowWindowCodes.SW_MAXIMIZE);

Related:

 

This topic was last updated on January 13, 2022, at 02:42:23 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2022 Eggplant