2009-05-11 18 views
3

WebアプリケーションのテストにWatiNを使用しています。 Enterキーを押してEnterキーを押し、Enterキーを押して2番目の値を入力してEnterキーを押すと、3つの値を1つずつ追加する必要がある項目を入力するフィールドがありますので、WatiN 。Watinを使用して複数の値をTextFieldに渡す方法

答えて

1

これは別の答えです。私はそこにキーを入力すると、 "Keyword delimiter is missing"というエラーが表示されていましたので、代わりに "\ r \ n"と表示されます。

WatiN.Core.IEすなわち=新しいWatiN.Core.IE():

のTextField txtChoices = ie.TextField(Find.ById( "ctl00_ContentPlaceHolder1_TxtChoices"));

txtChoices.TypeText( "NotBad");

System.Windows.Forms.SendKeys.SendWait( "\ r \ n");

txtChoices.AppendText( "VeryGood");

System.Windows.Forms.SendKeys.SendWait( "\ r \ n");

txtChoices.AppendText( "Awesome");

0

thankingyou

ホセが提案した上記の方法で、私はそれが私のために働いたコードに少し変更を加えました。 JusはTypeTextをAppendTextに置き換えて2番目の値を入力します。

WatiN.Core.IE ie = new WatiN.Core.IE();

TextField txtChoices = ie.TextField(Find.ById( "ctl00_ContentPlaceHolder1_TxtChoices"));

txtChoices.TypeText( "NotBad");

System.Windows.Forms.SendKeys.SendWait( "{ENTER}");

txtChoices.AppendText( "VeryGood");

関連する問題