How to pass multiple values ​​to TextField using Watin

I use WatiN to test web applications. There is a field called enter where I need to add 3 values ​​one by one by pressing the enter key, that is, add the 1st value, then press the enter key and add the second value, press the enter key, so please suggest me how to do this work using WatiN.

thankingyou

+3
source share
2 answers

Here is another answer to this problem. When I passed the input key there, it gave the error "Keyword Lack", so instead of "passe" "\ r \ n" it worked fine.

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( "\ \" );

txtChoices.AppendText( "VeryGood" );

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

txtChoices.AppendText( "" );

+1

, jose, , . Jus TypeText AppendText .

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" );

0

Source: https://habr.com/ru/post/1708056/


All Articles