A Comprehensive TestComplete Guide (Part-I):
As a part of our Software Testing Tools tutorial series, today we are covering a new GUI testing tool – TestComplete. This will be a comprehensive 3-part tutorial series.
Tutorials in this series:
- TestComplete tutorial 1: TestComplete Introduction
- TestComplete tutorial 2: How To Perform Data Driven Testing
- TestComplete tutorial 3: How to Automate Android Applications
Test Automation plays a vital role in the testing of any software. Some test cases are laborious, time-consuming and repetitive.
Automating such test cases can save a lot of time, which makes automation inevitable to the success of continuous delivery and testing models of software development.
What You Will Learn:
- Why use this tool?
- Installation of TestComplete
- Creating your first project in TestComplete
- TestComplete’s User Interface
- Creating our first test on a Web Based Project
- Recording a Test for the Web Application
- Analyzing test results
- Creating Test on Desktop Based Applications
- Recording the test for Desktop based Application
- Analyzing recorded test
- Recommended Reading
TestComplete, developed by SmartBear Software, offers support to a wide range of technologies such as .Net, Delphi, C++Builder, Java, Visual Basic, HTML5, Flash, Flex, Silverlight Desktop, The Web and Mobile systems.
Why use this tool?
TestComplete offers a wide range of test automation capabilities. Some of them are listed below
- Keyword Testing: Using the built-in keyword driven test editor testers can develop Keyword driven frameworks with ease
- Scripted Testing: Testers can write test scripts from scratch or modify recorded ones in a built-in editor
- Test Record and Playback: Provides the basic mechanism of record and playback for test creation. The recorded test cases can be modified as needed
- Integration to Bug Tracking Software: Integrates with various bug tracking software such as Jira, Bugzilla, etc. It can be used to modify or create items in bug tracking software using issue tracking template
- Data Driven Testing: Easy data extraction from CSV files, database tables, Excel sheets, etc.
- Test Visualizer: Captures screenshots during test execution allowing us to differentiate between expected and actual screens.
Minimum System Requirements
Operating System: Microsoft Windows XP Professional 32/64 bit.
Processor: Intel Core 2 Duo 2 GHz or higher.
Ram: 2 GB of RAM on other operating systems.
Hard Disk: 1 GB of free disk space for installation.
Resolution: 1024 × 768 or higher display resolution.
Mouse or other pointing devices.
Installation of TestComplete
Download => TestComplete can be downloaded from the official SmartBear web site from here.
After downloading, follow the steps to install TestComplete
#1) Double-click on the downloaded TestComplete setup package. Installation of the software will start and license agreements will be displayed.
#2) Specify the path of the folder where you want to install the software.
#3) Now, a welcome dialog is displayed asking to activate a license, we can start by clicking a 30-day trial license.
#4) After this process restarts the computer, we are finished the process of installing TestComplete.
Creating your first project in TestComplete
Launch the application and you will see the start page.
Follow these steps to create a new project.
1) Go to File menu.
2) Click New option from the menu.
3) Click New Project option.
(Note: Click on any image for enlarged view)
4) Alternately, you can use the shortcut key (shift + ctrl + N) to create a New Project.
5) A window will appear, give a name to the project.
6) Click on Finish.
7) Thus, we have created our first project in TestComplete.
TestComplete’s User Interface
TestComplete’s UI is well organized and divided into different sections.
- Project Explorer panel on the left side of the window, displays the project suites, projects, and their contents
- Workspace panel is where you can modify and create tests
- Test Visualizer panel(at the bottom) displays screenshots saved during test case execution
Creating our first test on a Web Based Project
Let us begin with creating our first web based project in TestComplete.
#1) Select File | New | New Project as shown in the screenshot.
#2) Enter the name of the project; you can also alter the location if required.
#3) Click on Next button.
Note: Since TestComplete supports different platforms like web, desktop, mobile, etc., we must select the platform on which we are testing.
#4) Initially, we are testing a web-based application, hence select “Functional testing of web pages”, and click Next.
#5) Once we have selected our platform in the previous step, a project creating wizard will take us to Test Visualizer page, where we can enable/disable the Test Visualizer functionality. Click on Next.
#6) Now we need to specify the scripting language for our project. After selecting the scripting language click on Finish.
Thus, our project to test a web application is ready.
Recording a Test for the Web Application
We will start with recording our test in which we will open in Google search engine and search for a query.
Follow steps to record the test:
#1) Click on Append to Test, as shown in the image below.
Note: TestComplete records user actions and typically mouse clicks, i.e. whenever the user clicks on any object, the id and references get recorded.
#2) A recording panel as shown in the image will be displayed, it indicates that recording of the test has started. Now we are all set to perform actions.
#3) Launch the browser, TestComplete identifies the browser with the special inbuilt test command.
#4) Navigate to this URL https://www.google.com
#5) Type any query on Google search box, say software testing help.
#6) Click on Stop button as shown in the image.
#7) Once we have clicked on the stop button, TestComplete will display keyword editor where all our recorded keywords are displayed.
#8) To playback, our recorded test cases simply click on Run Test button as shown in the image.
Analyzing test results
Let us analyze test results.
The run browser launches the browser. It detects the launched browser by inbuilt test functions and performs the test during playback.
This command is used to wait for the page to load; here we have opened Google homepage, so that means test execution is paused until Google home page has loaded completely.
The following command is used to set text in the Google search bar, we have used software testing as our keyword, and hence the following text is displayed.
In the Test Visualizer, the screenshots were captured during test execution, to enable the tester to differentiate between actual and expected screen output.
A word of caution: Please note that up until now we have only recorded a few basic steps. Realtime, this is never a complete test. You will have to add/remove/customize steps to make the script perform the validation that you need it to do.
Creating Test on Desktop Based Applications
TestComplete supports both Web as well as Desktop based Applications.
Let us begin with creating our project on Desktop Based Application.
Note: Close all projects which are opened in the TestComplete. Click File | Close.
#1) Create a new project-> File | New | New Project open a new project creation wizard.
#2) Specify the project name and location. Click Next.
Note: As we are running our test on a desktop application, choose Windows application on the wizard. This will take you to the page where we can specify the platform of the project. Select Generic Windows application and click Next.
Note: When we are automating desktop application, we need to specify the application to test in TestComplete
#4) Click on Add button, and specify the path of the project in the window that opens.
For demo purposes, we are creating our test on notepad.exe.
#5) Specify the path for the notepad.exe file on your machine
Eg : “C:\Users\Admin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Notepad.lnk”.
#6) Click OK. Then, Next.
#7) Choose the settings as needed for the Test Visualizer. Click Next.
#8) Select the scripting language. Click Finish.
We have now created a project to record our test on a desktop application.
Recording the test for Desktop based Application
Once we have recorded our test on a Web-based project, recording our test for Desktop based applications is simple.
#1) Click on Append to test.
#2) A new file of notepad will open.
#3) Write any text of your choice. Say, “Software testing help.”
#4) Click on the stop button.
#5) Close the notepad file.
#6) For playback simply click on Run Test.
Analyzing recorded test
Run Tested App is the command used to launch our application. Since we are performing our test on notepad.exe hence the name notepad is displayed in the Operation Column. TestComplete records the operation when the application is launched.
We have typed software testing help in the opened window of notepad, thus Edit command is used to set text in the application.
In this article, we have a very basic Introduction to TestComplete.
We have learned how to create Web Based and Desktop Based projects. We have recorded tests on two different domains and had learned to analyze the results.
At this point, please feel free to install the trial and work alongside. Try creating a project and record some tests. Get comfortable with understanding the steps and functions that the tool translates your actions into. This series is about to get serious- be prepared!
Part II – The second part of this tutorial is on the “Data Driven Testing using TestComplete”.
About the author: This is a guest post by Vivek, a QA Automation Engineer.
Questions? – Ask below. Comments? – Always welcome!