Hello friends!!! I hope you all have installed QTP into your machine as i have explained in my previous articles and you must have become familiar with the it’s IDE. Now let’s start with our first script of UFT.

We all are aware of that UFT does support recording as well as scripting facility to create the scripts, below is the list of ways through which you can create UFT script:

  1. Recording,
  2. Insert Step using keyword view
  3. Insert step using expert view
  4.  Static descriptive programming and
  5. Dynamic descriptive programming

Here in this article our focus will be on the first method rest of the other methods will be discussed in upcoming articles of Descriptive Programming.

  1. Recording:

To start recording first of all launch the UFT IDE as already explained in my previous article.

Then select New test as shown in the below screenshot:

1_NewTest

Or you can also try to open New Test using below shortcut:

2_NewTest

There is one more shortcut present on the start page to open new test:

3_NewTest

After clicking on New Test, UFT will show below window:

4_NewTestOptions

As throughout out whole series of UFT we are going to work on GUI test, so please select GUI Test option as shown in the above screenshot.

After selecting the option click on the Create button and you will get a blank editor to write a script, please see below the screenshot of the black editor window of UFT IDE:

5_UFT IDE AfterOpeningNewTest

Now click on the record button as shown in the below screenshot:

6_StartRecording

You can also use below shortcut to start recording:

7_StartRecording

UFT will open “Record and Run Settings” window:

8_RecordAndRunSettings

 

9_RecordAndRunSettings

As we all know that UFT can be used for automation of Desktop based and Window based applications, that is why you can see there are 2 tabs in the “Record and Run Settings” window, one for Web and one for Windows applications.

We are going to record our first script on IE so we are going to select Web tab for recording. Once the recording has been started you can see a small bar as shown below on the screen:

Lets understand this small bar, Recording GUITest is the name of the test which we are recording, the number in the bracket is showing total number os recorded line of code, there is one square button to stop recording at anytime, next to that it is a dropdown contains all the Actions created in this script, then there is one more dropdown showing the recording mode (Normal, Low level, Analog, Insight), right now it is showing the default recording mode i.e. Normal recording mode, nest to that a spy option is present.

10_WhileRecording

Start performing steps on your browser, let’s say in our case we have recorded simple 4 line:

  1. Launch IE browser
  2. Open www.google.com
  3. Write QTP in the search box
  4. Click on the Search button
  5. Close browser

This is how your browser will look like while recording a script:

11_WhileRecording

This is how your script will be recorded:

12_RecordedScript

So this was a brief introduction to recording, and how can we create our script very easily. I hope this was clear to you all and if you have any doubt about this article please feel free to ask us.

In our next article we are going to discuss about different recording modes. Please follow our articles for more inform on UFT and automation techniques.

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *