Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用断线在文本字段中输入值来检查应用程序的某些功能。像这样:
value1 value2
我使用 Environment.NewLine, "\r\n" 但 WatiN 将它们转换为空格:
MyField.Value=("value1"+Environment.NewLine+"value2"); MyField.Value=("value1"+"\r\n"+"value2");
手动一切正常。有没有办法真正模仿在 WatiN 中输入断线?
两种解决方案都适用于设置为超过 1 行的文本区域:
textArea.SetAttributeValue("value", "abc" + Environment.NewLine + "123"); textArea.TypeText("abc" + Environment.NewLine + "123");
确保将字段设置为支持多行。