Forum Discussion

fkr717's avatar
fkr717
Occasional Contributor
10 years ago
Solved

How to use CTRL-A (select all) when recording test

Brand New to TestComplete, using version 10.  Testing a windows form application written in C#.  Using .NET v4.5.

 

This is my first day working with Test Complete so I am writing a simple test to open a form, remove all the data that is in a text field (Ctrl-A, Backspace) then enter some new data and validate that the text field is filled in properly.  Unfortunately Ctrl-A does not work in the test recorder.  Any thoughts on how to accomplish this?  Thanks, Kurt

  • My 2 cents on this older request. I've learned my lesson with using the setText method, as you may skip some validations on some controls.

     

    Use the Keys method, and start the keys with ^a and then your text. IE "^atext"

4 Replies

  • colinstrydom's avatar
    colinstrydom
    Occasional Contributor

    My 2 cents on this older request. I've learned my lesson with using the setText method, as you may skip some validations on some controls.

     

    Use the Keys method, and start the keys with ^a and then your text. IE "^atext"

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kurt,

    Welcome to the TestComplete community!

     

    Actually, you can simply use the wText property that will set a new text into the text field. There is no need to remove the current content from it. Please refer to the "wText Property (Window Objects)" ( http://smartbear.com/viewarticle/55395/ ) help topic.

     

    Does it help?

    • fkr717's avatar
      fkr717
      Occasional Contributor

      So this is a windows form application, when I go to that item in my test I see a wText[Get], but no way to set using that method.  Maybe I am missing something.  Here is a short video which shows what I am talking about.

       

      Watch it Here!

       

       

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I see on the video that there's a SetText in your list.  Use that one and you shouldn't need to clear out the field first.