Forum Discussion

ThunduBeedi's avatar
ThunduBeedi
Occasional Contributor
13 years ago

TestComplete types Enter key twice for VbCrLf character.

While doing a Keys() function with VbCrLf in notepad.exe, TestComplete is typing the Enter key twice. TestComplete documentation mentions VbCrLf is interpreted as newline in Windows platform. 



Set testObject = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1).Window("Edit", "", 1)



testObject.Keys(VbCrLf)





4 Replies

  • Hello Krishna,



    You can try this:



    testObject.Keys(VbCr)



    VbCrLf sends two characters: Carriage Return and Line Feed. VbCr should only send Carriage Return. You can also check this article.



    Otherwise, you could try this:



    testObject.Keys("[Enter]")



    This is considered an Enter keystroke, instead of sending a character you "press Enter key"



    My knowledge of VB is a little far far away in time, but I hope it helped
  • Hi Team,

      In my application, I have to press (Ctrl+Shift+E) on a particular selected row using VB script. Please suggest me the way to do this once the row is selected. I tried working with Sys.keys "[ctrl]" "[Shift]" "e" and also with sys.desktop.keys. But it did not work for our infragistics grid.