0 Shares 421 Views

Create your first test with TestComplete

Mar 25, 2013
421 Views
Sample Recorded Script

 

There are two types of test in TestComplete.

Keyword Test :  This is a visually represented and documented test which provides a simple and easy way change and design the test. If you are not familiar with VBScript or other programming language then you can design your tests using Keywords.

Script Test : This direct scripting statements to achieve the tests. One should be familiar with VBScript or other programming language.

TestComplete provides commonly used code templates, which can be helpful while you script. Press Ctrl + J to open Code Template and select one which you need to use.

 

Code Template

Code Template

You can add, modify or delete these code templates as per your need. Go to Tools | Options

Panels | Code Editor | Code Templates

 

Option Dialogue for Code Template

Option Dialogue for Code Template

Create a Test Project

Menu Bar– File | New | New Project Suite

This will open new project suite dialog. Enter your Project Suite Name in the Name Field. If you wish to change the save location of your project suite change the Location Field.

Right Click the Project Suite in Project Explorer, Select Add | New Item

This will call Create Project dialogue box. Enter Project Name, Location and the scripting Language you are comfortable in.

 

Create Project

Create Project

You may choose the New Project wizard as well from the start Page to create a new project.

 TestedApps Project Item :  TestedApps includes a list of tested applications and their attributes (command-line parameters, the number of instances to run and so on). The TestedApps object holds one item from the list. It has methods and properties that can set application attributes, launch or close the application and so on.

to add a TestedApps object – right click on TestedApps project Item Add | New Item

Select the program start-up file to be tested to add.

Recording Test : If you are not comfortable to write operating software footsteps, you can create your test by recording the steps.

start recording – Menu bar – Test | Record | Record Keyword test   or    Test | Record | Record Script

or click the record button on tool bar

 

Start Recording

Start Recording

After start recording, record toolbar displays.

This toolbar includes some additional features, you can use the  recording script or stop recording, and insert comment.

 

Recording Toolbar

Recording Toolbar

perform your test steps and once done press stop recording.

Playback : to execute your test, press Run Test button or Run Script Routine button.

or you can add your items in Test Items pane and the select Items to Run and press Run Focussed Item Button.

 

Playback

Playback

Result Logs : To view the results of test execution, open Logs

Test Log

Test Log

Test Log contains following information

 Error: Error message

 Warning: Warning Information

 Message: Message information

 Event: Event Information

 Image: Image Information 

Double-click the Log Information can be targeted to generate the script parameter information statement.

 

Lets Understand Recorded Script

Here is a sample recorded script on Notepad.

Sample Recorded Script

Sample Recorded Script

TestedApps.**.Run is to start the application under test.

Aliases :  TestComplete provides Aliases for the object the establishment of a “Alias” Tree. The alias tree in the created Namemapping When created, the tree structure and Namemapping is same.

edit.click(20,13) – mouse click at particular location.

edit.Keys(“***”) – to set the text in the edit box.

 

Checkout the Video on creating first test with TestComplete

 

You may be interested

Setting up Mobile Automation Project in Windows
Katalon Studio
77 views
Katalon Studio
77 views

Setting up Mobile Automation Project in Windows

Saket - Sep 20, 2017

This tutorial explains how to setup a mobile automation project and test a mobile app using Katalon Studio on Windows. This tutorial assumes that you are familiar…

Katalon Studio GUI Overview
Katalon Studio
147 views2
Katalon Studio
147 views2

Katalon Studio GUI Overview

Saket - Sep 14, 2017

GUI Overview After installing and setting up Katalon Studio for your automated test, you must understand the GUI. In this post we will walk you through the…

LeanFT Tutorial #4: Application Model Overview
LeanFT
124 views1
LeanFT
124 views1

LeanFT Tutorial #4: Application Model Overview

Saket - Sep 10, 2017

In this post we are going to focus on Application Model in LeanFT. Refer our earlier posts on LeanFT Getting Ready with LeanFT Browser Extensions and Settings…

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...