Forum Discussion

lmackintosh's avatar
lmackintosh
New Contributor
13 years ago

Automate a window already open and record from there

Hi,



I hope you can help. I wish to automate a window which is already open and start recording steps from where I am. For example, the test I wish to run involves a login process. I would like to perform this login process outwith the recording then automate the window, and start recording new steps from a selected point. (the way Telerik allows me to do...)



An example is when I created a 20 step test but fogot to click the Logout button at the end. I wanted to just add in this one step, but was unable to find a way to do it.



Any help would be great.

Thanks

Leanne

3 Replies

  • Hi Leanne,



    With TestComplete, you can start recording a script or keyword test and perform the actions you need to record. If you do not want to record some actions during the test recording, you can suspend the recording by clicking the Pause button on the Recording toolbar and then, after you have performed these actions, you can click the Resume Recording button to continue recording the script or keyword test.



    TestComplete can record a new script routine or keyword test or insert the recorded user actions into the existing script or keyword test. This behavior depends on the "Always start a new test" TestComplete option. By default, this option is enabled, and TestComplete starts recording a new script routine or keyword test when you initiate the recording process. If this option is disabled, TestComplete inserts the recorded script statements or keyword test operations into the current position in the script or keyword test. So, if you need to record some new actions with your application and append them to an existing scripting routine or keyword test, you can disable the "Always start a new test" option, put the cursor into the needed place in your script code or keyword test, run your application, perform the needed actions which you have already recorded, then start the recording, perform the actions you need to be recorded and appended to the test and stop the recording after all the needed actions are performed. TestComplete will insert the recorded actions into the script or keyword test recorded earlier.



    If you use keyword tests, you can also start the recording by clicking the Append to Test button on the Keyword Test editor's toolbar to insert newly recorded operations into the current position in the existing test or append them to the end of the test.



    For more information, please see the Starting, Pausing and Stopping Recording and Inserting Recorded Commands Into the Current Test sections of the Recording Tests - Overview help topic.
  • Hi Vladimir,



    Thanks for your in depth response. It's exactly what I was looking for. Do you happen to know if it's possible to run a selected batch of steps on a window you already have open? (and have navigated to the start of the first step you wish to run)



    Thanks again

    Leanne
  • Hi Leanne,



    If you have a test recorded over a certain application, you can manually run your application, perform some preliminary user actions over it (if needed) and then execute the test that will work with the application's window(s). However, TestComplete makes the testing process easier by providing the Tested Applications collection. This project item allows your test to launch the application(s) to be tested automatically.



    If your test was recorded as script code, you can execute the needed routine by placing the cursor somewhere within the routine's code and clicking the Run Current Routine button on the Code Editor toolbar or by right-clicking the needed script unit in the Project Explorer panel and selecting the needed routine name from the Run submenu of the context menu. Note that TestComplete executes the whole routine. Unfortunately, there is no way to execute only certain script statements selected in a routine's body (not the whole script routine).



    If you use a keyword test, you can run the whole test (simply open it in the Keyword Test editor and click the Run Test button on the editor toolbar), as well as an individual keyword test operation in the test (right-click it in the editor and select Run Selected Operation from the context menu). Also, you can right-click a certain keyword test operation in the editor and select Run from Selected Operation from the context menu to execute a group of operations from the selected one to the end of the test. For more details, please see Running Keyword Tests.



    You can find more information on running TestComplete tests in the Running Tests help section.