0

I want to enter value into text field with break lines to check some functionality of application. Like this:

value1
value2

I used Environment.NewLine, "\r\n" but WatiN translates them into spaces:

MyField.Value=("value1"+Environment.NewLine+"value2");
MyField.Value=("value1"+"\r\n"+"value2");

Manually all is OK. Is there a way to really imitate entering a break line in WatiN?

SimonD
  • 1,441
  • 2
  • 18
  • 30
  • have you seen this? [http://stackoverflow.com/questions/856766/can-i-pass-a-key-stroke-i-e-enter-key-into-application-using-watin-scripts](http://stackoverflow.com/questions/856766/can-i-pass-a-key-stroke-i-e-enter-key-into-application-using-watin-scripts) – markpsmith Oct 30 '12 at 16:11

1 Answers1

0

Both solutions worked for me in a textarea set to more than 1 row:

textArea.SetAttributeValue("value", "abc" + Environment.NewLine + "123");

textArea.TypeText("abc" + Environment.NewLine + "123");

Make sure you set your Field to support multiple lines.

felipeclopes
  • 4,010
  • 2
  • 25
  • 35