Sunday, 24 January 2016

QTP - 36 - Version control with QTP !

Version control is used to trace, manage and control the history of each software change. It includes all the changes like what was done, who did it and also the reasons. It lets you to track the changes in the scripts over a period of time. We can also look back and see that what changes were done at a particular period of time and who did it. We can also revert our scripts to the older versions if needed. It allows three main things in the software that is  reversibility , concurrency and annotation. So lets talk about version control in QTP.

Reversibility -  the ability to back up to a saved, known-good state when you discover that some modification you did was a mistake or a bad idea

Concurrency- the ability to have many people modifying the same collection of code or documents knowing that conflicting modifications can be detected and resolved.

Annotation means  attaching explanatory comments about the intention behind each change to it and a record of who was responsible for each change.

For version control with QTP we need to have licenced tool QC or ALM. We need to integrate the ALM with the QTP. Once the version control is configured then all your ALM assets (including resources) cannot be modified anymore without checking them out. Each time we need to check out and make our changes and check back in to view our changes.
QTP recognizes the version control being enabled, and behaves accordingly (requires (and supports) checkout before modify, and so on).

Note : Always the latest version of Asset is checked out to a user

Thursday, 21 January 2016

QTP - 35 - Record and playback

QTP/UFT also provides the option of recording the tests and re-play it. We have an option of record on the toolbar menu , we can select the modes of recording and record the steps. We can also apply checkpoints in record mode. Mouse and keyboard movements can also be captured in record playback mode.

New Test Page

Although record-playback functionality is not used much but we have its advantages too. Lets discuss about each of the advantages and disadvantages :

Advantages : 

It can be used for an application for which maintenance is not required.

It can be used for recording both mouse movementa and keyboard inputs.

It is considered easy for beginners because it takes less time and knowledge to get started.

Faster test development (though eventually maintenance and debugging time would over-weigh this advantage)

POC can be easily created for a quick demo.



Disadvantages : 

Its very Fragile, a simple change may lead to lot of changes.

We can't apply any validations while recording.

It may record un-necessary steps depending upon the level of recording present in tool.

The test data is hard coded in scripts.

Tough to maintain the codes for any changes in the software.

Tuesday, 19 January 2016

QTP - 34 - Significance of each type of action call

We can create/call an action directly from an existing action by right clicking in the script area :
Action Properties

So basically we can see here that there are three options to call an action. Lets see significance of each one of them :

1) Call to a New action - This option is used to insert  a new action from the  existing action.

2) Call to Copy of an Action - This option inserts a copy of the existing action.
As the name says this option directly copies all the attributes of the action which we are calling. It copies checkpoints, repositories, data tables and action tab in data table. Since this is the copy of the source action so it is always editable and any changes made will be local only. The source action remains unaffected. We can use this functionality with both the reusable and non-reusable actions. Target can be changed without modifying the source.

3) Insert call to Existing action - Inserts a call to existing reusable action.
This is different from the above type of the action. Only the reusable action can be called using this action. All the attributes like checkpoints, repositories,etc are in read-only mode and are non editable. The action can be modified in the that test only in which it was created. Once the source action is changes all the targets will be changed.

Note : If we have to use an action with modification then we can go for " Call to copy of an action" and if modification is not required then we can go for "Call to Existing Action".