Forum Discussion

marek_tomecka's avatar
12 years ago

Write to file + 1

Hello



I need and advice about TestComplete program in Visual Basic language.

I need to write a text in Notepad program:



Example x

where x is number of the last created example + 1.

The test will be turn on repeatedly so a few examples will be created.



Could someone help me please?

1 Reply


  • Hi Marek,


     


    Here is the sample code:


    Sub Test


     Dim obj, index


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


     For index = 1 To 10 


      obj.Keys("Example " & index & "[Enter]")


     Next

    End Sub


     


    Is this what you are looking for?