ZennoLab Assemblies Documentation
FindElementByIntelliSearch Method
Example 

Type: System.String

The form for searching. It's can be name on one of supported languages or id from current IntelliSearch base.

Type: System.String

The class of element for searching. It's can be name on one of supported languages or id from current IntelliSearch base.

Type: System.Boolean

The true if are searching html link; otherwise false. In case then isLink is true, parameter "form" can be empty. It's not error if "form" not empty, however this parameter is not used.

Type: System.Boolean

The true if allowed to search among the locked html elements; otherwise false.

Searches for an HTML element using IntelliSearch technology, and returns the first or the most appropriate occurrence.
Syntax
public HtmlElement FindElementByIntelliSearch( 
   string form,
   string elementClass,
   bool isLink,
   bool inBlocked
)

Parameters

form

Type: System.String

The form for searching. It's can be name on one of supported languages or id from current IntelliSearch base.

elementClass

Type: System.String

The class of element for searching. It's can be name on one of supported languages or id from current IntelliSearch base.

isLink

Type: System.Boolean

The true if are searching html link; otherwise false. In case then isLink is true, parameter "form" can be empty. It's not error if "form" not empty, however this parameter is not used.

inBlocked

Type: System.Boolean

The true if allowed to search among the locked html elements; otherwise false.

Return Value

Type: HtmlElement

The element found by the search.

Remarks

The parameters form and elementClass can be name on one of supported languages or id from current IntelliSearch base. IntelliSearch not depend not on the language or the version of the program. IntelliSearch is a multi-language system. However, depends on the current versions of the standard base and additional base (user base). Currently supports two languages: English and Russian. Do not forget that before using IntelliSearch must choose one of the standard base. Also the name of a class of elements and forms may vary in different versions of the base. The case of strings does not matter.

The parameter isBlocked should use if need find html element which was used by IntelliSearch. After using of the element, IntelliSearch marks html element as a blocked and ignores it in followings searching. If need find element among all or among the blocked then isBlocked should be true; otherwise false.

Example
The following example uses the FindElementByIntelliSearch method. At first search the link with class "Simple registration" and click on this element, next field with class "Password" on the form with class "Registration" and sets value "password". Finally again field with class "Password" on the form with class "Registration" and sets value "password" and gets value of this field.
// clear cookie
instance.ClearCookie();
 
// navigate to lessons.zennolab.com
instance.ActiveTab.Navigate("lessons.zennolab.com", "");
 
// waiting for downloading
instance.ActiveTab.WaitDownloading();
 
// find link by IntelliSearch
HtmlElement he = instance.FindElementByIntelliSearch("", "Simple registration", true, false);
 
// if html element found
if (!he.IsVoid) 
{
    // click on link
    he.RiseEvent("click", "Full");
}
 
// find password field
he = instance.FindElementByIntelliSearch("Registration", "Password", false, false);
 
// if html element found
if (!he.IsVoid)
{
    // set value
    he.SetValue("password", "Full", false);
}
 
// find password field again in blocked
he = instance.FindElementByIntelliSearch("Registration", "Password", false, true);
 
// if html element found
if (!he.IsVoid)
{
    // get value
    return he.GetValue(false);
}
// clear cookie
$instance->ClearCookie();
 
// navigate to lessons.zennolab.com
$instance->ActiveTab->Navigate("lessons.zennolab.com", "");
 
// waiting for downloading
$instance->ActiveTab->WaitDownloading();
 
// find link by IntelliSearch
$he = $instance->FindElementByIntelliSearch("", "Simple registration", true, false);
 
// if html element found
if (!$he->IsVoid) 
{
    // click on link
    $he->RiseEvent("click", "Full");
}
 
// find password field
$he = $instance->FindElementByIntelliSearch("Registration", "Password", false, false);
 
// if html element found
if (!$he->IsVoid)
{
    // set value
    $he->SetValue("password", "Full", false);
}
 
// find password field again in blocked
$he = $instance->FindElementByIntelliSearch("Registration", "Password", false, true);
 
// if html element found
if (!$he->IsVoid)
{
    // get value
    return $he->GetValue(false);
}
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

Instance Class
Instance Members

Send Feedback