AttachToNativeElement - web automation method

Automates an existing instance of IE6 - IE9 browser and creates a web automation library Element object from a native Internet Explorer web object.

Applies to:
  var e = coreObj.AttachToNativeElement(nativeElementObject);
Returns an Element library object. The nativeElementObject parameter is a native Internet Explorer HTML element ( IHTMLElement ). It could be obtained using other ways than Twebst web automation library features. It could be also obtained by using nativeElement property. This method is useful if you already have a native Internet Explorer web control and you want to use it as a library Element object.
// Start an Internet Explorer object.
// Get the body native element and attach to it.
// Use the attached library Element object.
var internetExplorer     = new ActiveXObject("InternetExplorer.Application");
internetExplorer.Visible = true;

var coreObj         = new ActiveXObject("OpenTwebst.Core");
var body            = internetExplorer.Document.body;
var attachedElement = coreObj.AttachToNativeElement(body);

See also:
Core | Browser | AttachToHWND | AttachToNativeBrowser | AttachToNativeFrame | nativeBrowser | nativeFrame | nativeElement

© 2017 CodeCentrix Software. All rights reserved.