Sunday, 25 August 2013

Understanding Descriptive Programming: Part 1

HI Folks..
In This Post I will be describing what is descriptive Programming in using VBScript(QTP), and define the various types of descriptive programming.

What is Descriptive Programing(DP):   Before understanding the DP, we must first know what is Object.
In QTP , Object is anything with a set of properties and methods(functions).
It can be any visual entity displayed on the screen as WebPage,Button,Dropdown(Weblist), all of these are type of Objects.(Although it is not necessary that each object should be visual too, this is done with a specific property .)
Now every object has a set of property with which it is defined, such as a WeButton named as "Submit" will have a set of propertys such as 'name', 'htmlid','innertext','outertext',etc
QTP understanding the entire given script in terms of Objects and the operation performed upon them .
Such as click on the submit button, then within the code we specfiy the object and perform the operation.


now the code might look as

Set buttonObj=Browser("sampleBrowser").page("samplePage").WebButton("Submit")
buttonObj.click

OR
Browser("sampleBrowser").page("samplePage").WebButton("Submit")

both of the statments are virtually same.

now if we are not using the DP methods then the properties of the submit button are  stored in Object repositories.and we can directly specify the name and the location of the object.The properties of the submit button are specified within the OR itself and user does not require to provide the information regarding submit button in code .(As shown in the code above).

But When we use the DP the properties through which object is described in the application(Description properties) will be specified within the code.(Without using the OR)


We will be looking deep into the DP in later parts of the Post.

QTP Basics Part1: Features and Usability of QTP

Hi folks !!!!!

In this series I am gonna describe the basics of the QTP step by step.

First I will be covering the QTP basics then I will be moving to more advanced step.


What is QTP (Quick Test Professional)?:

QTP is software testing automation tool provided by HP.
Main advantages/Reason for using QTP for automation as per below......

1.Fast test creation.(By Use of Keyword views,as well as the provision of modularity)
2.Easier maintenance.
3. Extremely powerful data validation capabilities within the tool.(features provided from the tool it self  in form of checkpoints*).
4 Smart Identification* support from tool.
5. Tool Based provision for recovery scenarios*.
6.Auto documentation*.


* Will be explained in later posts

How to use ByRef parameter calling in Vb Scripting.

Most of the time automation personnel don't use the ByRef parameter functionality.
They use normal function calling with which is by default byVal.

Now actually most of the time tester don't know these two feature.so first I m gonna explain there two one by one.

1.ByVal Function calling.

Syntax:

var1=ADD(parameter1,parameter2)




Function ADD(val1,val2)

 val1=val1+1
  ADD=val1+val2


End Function


Function ADD(ByVal val1,ByVal val2)

 val1=val1+1
  ADD=val1+val2


End Function


now in this case the parameter calling is ByVal.In fact both of the statements are identical.

when we byval prefix , it means only a copy of the parameter is going within the function.Any Changes made within  the parameter wont reflect the in the actual called value.
but if we use below syntax


var1=ADD(parameter1,parameter2)
Function ADD(ByRef val1,val2)

 val1=val1+1
  ADD=val1+val2


End Function


in this case any changes made in val1 will reflect in parameter1 too.



QTP Tutorial

Hi Folks  a page is getting launched , which will be dedicated to QTP Tutorials
This is collect step by step process to learn QTP Automation, within BPT Framework.

A New Page Dedicated to DataBase Testing

Hi Folks this is a page which will be dedicated to Database Testing

A New Page Dedicated to HP-Quality Center

Hi Folks this is a page which will be dedicated to HP-Quality Center .
We will discuss about HP-QC/HP-ALM along with HP OTA related topics here

Function Calling In VB Scripting, use of parenthesis

In VB scripting we notice two type function call syntex as per below

syntex1
Object.func1 parm1,param2

syntex2
Object.func2(param1,param2)

Now the question is what is difference between these two syntax.The answer is quite simple , it depends on the context . NO matter what the function is , if you are going to assign the return value to some variable or the result of the function call is used as input for some other function then the function should have the parameters in parenthesis.

example
msgbox "Hi"
msgbox trim(" Hi ")