FindChildElement - web automation method

Searches inside a container object, a direct HTML child element that matches a tag-name and verifies a list of Search Conditions.

Applies to:
Frame, Element
  var e = obj.FindChildElement("tag_name", Search conditions);
Arguments:
This method accepts a variable number of Search Condition arguments. Any HTML attribute is accepted in search conditions. uiName is also accepted as attribute in search conditions, in this case the text name of the HTML element is used in search. A special zero-based index attribute is available in search condition specifying the ordinal position in the collection of objects generated by the remaining search conditions. If no search condition is provided, then the first element that matches the tag_name is returned.
Remarks:
The method returns a web automation Element object that matches the search condition arguments and has the specified tag_name. It provides programmatic control over the underlying IHTMLElement native object exposed by IE browser. If no element verifies the search conditions, then null is returned.
In case of an error the method throws a macro exception and the lastError property of the core object is set as follows:
The time allocated for search is specified by the searchTimeout property. If loadTimeout is not zero, then the method waits the browser objects to be completely loaded in the amount of time specified by the property. If the timeout has expired the lastError property is set to LOAD_TIMEOUT_ERROR. In this case, if loadTimeoutIsError property is true, then a script exception is thrown.

If the container object is a macro Frame object, then the method searches the element in the HTML document associated with the frame. If the container object is a macro Element object, then the method searches the element among the direct children elements of the container element.
Example:
var coreObj = new ActiveXObject("OpenTwebst.Core");
var browser = coreObj.StartBrowser("http://www.codecentrix.com/");

var element = browser.topFrame.FindChildElement("a", "text=Download");
element.Click();
		
See also:
Element | FindElement | loadTimeout | searchTimeout

© 2017 CodeCentrix Software. All rights reserved.