ZennoLab Assemblies Documentation
SendText Method
See Also  Example Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > Instance Class : SendText Method
text

Type: System.String

The text for typing.

latency

Type: System.Int32

The latency between the input characters of text.

Glossary Item Box

Emulates the typing.

Syntax

C# 
public void SendText( 
   string text,
   int latency
)

Parameters

text

Type: System.String

The text for typing.

latency

Type: System.Int32

The latency between the input characters of text.

Example

The following example uses the SendText method.
C#Copy Code
// clear cookie
instance.ClearCookie();
 
// navigate to lessons.zennolab.com
instance.ActiveTab.Navigate("lessons.zennolab.com", String.Empty);
 
// wait downloading
if (instance.ActiveTab.IsBusy) instance.ActiveTab.WaitDownloading();
 
// try find textarea
HtmlElement he = instance.ActiveTab.MainDocument.Body.FindChildByTag("textarea", 0);
 
// if html element is not empty
if (!he.IsVoid && !he.IsNull)
{
    // focus on this element
    he.Focus();
    // send text
    instance.SendText("It's just simple text for typing. Look at the textarea element and you can see this text.", 200);
}
PHPCopy Code
// clear cookie
$instance->ClearCookie();
 
// navigate to lessons.zennolab.com
$instance->ActiveTab->Navigate("lessons.zennolab.com", "");
 
// wait downloading
if ($instance->ActiveTab->IsBusy) $instance->ActiveTab->WaitDownloading();
 
// try find textarea
$he = $instance->ActiveTab->MainDocument->Body->FindChildByTag("textarea", 0);
 
// if html element is not empty
if (!$he->IsVoid && !$he->IsNull)
{
    // focus on this element
    $he->Focus();
    // send text
    $instance->SendText("It's just simple text for typing. Look at the textarea element and you can see this text.", 200);
}

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

© 2013 All Rights Reserved.