Forum Discussion

kam_marwaha's avatar
New Contributor
11 years ago

New to Automation - The very basics

Hi Guys,

Currently, I'm a strong manual tester who has been tasked with learning automation. The tool we chose was TestComplete.The thing I need help with is how do I get TestComplete to run a script I've written. It keeps saying there's no routine when I try and drag my script (unit1) to the 'Keyword Tests'.

I have tried using record and playback, and that seems to work fine - however I really want to create and run my own scripts from scratch. 

I have tried reading through the help files and tutorials but I cannot find the section on running custom script successfully. 

Could anyone help. Thanks.

5 Replies

  • Here's a very basic discription:

    Keyword tests - tests that you create using the test recorder using onscreen elements

    Scripts - tests written in a scripting language of your choice.

    Projects suite - a collection of projects that contain keyword tests and or scripts

    Projects - a group of keyword tests and or scripts that make up that project.

    Your custom script test can be ran several different ways.

    1) place the script as part of the project test items - this is one of the main tabs of the project.

    2) open the script and select the run script (test)

    Hope that helps.

  • sbkeenan's avatar
    Frequent Contributor
    Hi Kam

    Firstly, welcome to the world of TestComplete.  Hopefully, like me, you'll find the user forum a useful resource!!

    Based on what you have written, it sounds like you are trying to copy a script that has been written in a scripting linguage into what TestComplete calls Keyword Tests.

    If I have understood you correctly, what you need to have done during the creation of your project is to decide on a scripting language, JScript, VBScript, DelphiScript, etc., you'll see the available list of options when you do this.  Thereafter, you should create your scripts in the 'Script' area of the project.

    It also sounds like you may have written your script outside of TestComplete.  In that case, you'll need to import it, but that is something that I have no experience with myself.  I do all my script development within TestComplete's own IDE.

    Hopefully, this will point you in the right general direction though!!


  • HKosova's avatar
    SmartBear Alumni (Retired)
    Hi Kam,

    It's not C#; it's C#Script, which is JScript with square bracket notation foo["bar"]["baz"] instead of dot notation C#Script has a very specific purpose of writing C#-compatible code for C# Connected Apps - apps that talk to TestComplete via COM. So, unless you plan to do Connected Apps, don't use C#Script (it's hard to read); use JScript instead.

    If you want to write your tests using .NET features, you can use .NET classes via the dotNET object, and reference .NET assemblies by adding them to Tools | Current Project Properties | CLR Bridge. But almost always there're built-in TestComplete features and objects to do the job. For example, you can use TestedApps to run apps or aqFileSystem to work with files and folders.
  • Thanks guys, I figured it out. It looks like the IDE didn't recognise my function correctly.

    I'm trying to include the namespace using System.Diagnostics; and it doesn't seem to like it.

    l'm scripting in C#, also method like system.process need to be abbrievated sys.process, which I do not understand as to why this needs to be the case. 

    Could someone clarify? 

    Sorry, I know I'm hard work :(