Forum Discussion
ThunduBeedi
13 years agoOccasional Contributor
TestComplete version is 8.20
Dim string = "line1[Enter]line2"
Set TestObject = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1).Window("Edit", "", 1)
TestObject.Keys(string)
This will type line1, Enter key and line2.
But, if instead of [Enter] if we use the actual character for Enter key which is \r\n or \n or \r, TestObject.Keys will type Enter key twice.
Dim string = "line1[Enter]line2"
Set TestObject = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1).Window("Edit", "", 1)
TestObject.Keys(string)
This will type line1, Enter key and line2.
But, if instead of [Enter] if we use the actual character for Enter key which is \r\n or \n or \r, TestObject.Keys will type Enter key twice.