Académique Documents
Professionnel Documents
Culture Documents
htm# Ti
Reusable action:-
It is an action which contains business logic recorded
events.That action can be made as reusable
and it can be used in another test by using either
call to or copy of action.
Reusable function:-
It is an user defined function which is defined in the
action for any logic which needs replication. It can be
called whenever we need by mentioning its name or by
call statement.we can also use by having vbs file name
means having the function definition part in the vbs
file and calling that vbs file using executefile
statement.
1.Repository:- files are created Test manager or test lead or senior S/W engineer.
so we have to add or load or executes these repository files using within a script or using
QTP tool .
2. library files :-After loading the repository file,then the library files are loaded
dynamically into the scripts.
This library file contains functions&sub procedures&verification checks,reports.
Then these files are loaded dynamically into the test in two ways:
[a] before creation of library files we creates a functions(just record the functionality of
the app and mention the function name at first and copy the script and paste into notepad
and save as .vbs extention and save this a folder which we want to create at first and give
the folder name as Re_Usable_ Functions) .
Then if u want to make this file as reusable then go to Test tab and select Test settings-
select Resource tab &click +button&browse the location of the Vbscript file which u
stored in Re_Usable_ Functions folder.then this function is reusable,u can use this file
with that function name like:function().
[b]loading library file at runtime u can use the statement-ExecuteFile("full path of the file
This is the one type of frame work.We called it as Master FrameWork or Action
FrameWork.
Check Points in QTP:
Browser("Google").Page("Google").WebRadioGroup("meta").Check
CheckPoint("meta")
Well let’s take a look at approach that QTP takes. Whenever a checkpoint is created QTP
add a Checkpoint(“<Name>”) object to the script.
Test and Run-time Object
What is the difference between Test Objects and Run Time Objects ?
Test objects are basic and generic objects that QTP recognize. Run time object means the
actual object to which a test object maps.
Can i change properties of a test object
Yes. You can use SetTOProperty to change the test object properties. It is recommended
that you switch off the Smart Identification for the
SMART Identification:-
Smart Identification is nothing but an algorithm used by QTP when it is not able to
recognize one of the object. A very generic example as per the
QTP manual would be, A photograph of a 8 year old girl and boy and QTP records
identification properties of that girl when she was 8, now when
both are 10 years old then QTP would not be able to recognize the girl. But there is
something that is still the same, that is there is only one girl in
are able to recognize the objects that are dynamic or inconsistent in their properties.
When the script has been created, the SI should be enabled,
so that the script does not fail in case of small changes. But the developer of the script
should always check for the test results to verify if the SI
feature was used to identify a object or not. Sometimes SI needs to be disabled for
particular objects in the OR, this is advisable when you use
SetTOProperty to change any of the TO properties of an object and especially ordinal
identifiers like index, location and creationtime.
Descriptive Programming:
Whenever QTP records any action on any object of an application, it adds some
description on how to recognize that object to a repository of objects called object
repository. QTP cannot take action on an object until unless its object description is
in the Object Repository. But descriptive programming provides a way to perform
action on objects which are not in Object repository
Below are some of the situations when Descriptive Programming can be considered
useful:
The objects in the application are dynamic in nature and need special handling to
identify the object. The best example would be of clicking a link which changes
according to the user of the application, Ex. “Logout <<UserName>>”.
When object repository is getting huge due to the no. of objects being added. If the
size of Object repository increases too much then it decreases the performance of
QTP while recognizing a object.
When you don’t want to use object repository at all. Well the first question would be
why not Object repository? Consider the following scenario which would help
understand why not Object repository
Scenario 1: Suppose we have a web application that has not been developed yet.
Now QTP for recording the script and adding the objects to repository needs the
application to be up, that would mean waiting for the application to be deployed
before we can start of with making QTP scripts. But if we know the descriptions of
the objects that will be created then we can still start off with the script writing for
testing
Modification to a test case is needed but the Object repository for the same is Read
only or in shared mode i.e. changes may affect other scripts as well.
When you want to take action on similar type of object i.e. suppose we have 20
textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on.
Now adding all 20 the Object repository would not be a good programming
approach.
When you use a property name for the first time the property is added to the
collection and when you use it again the property is modified. By default each
property that is defined is a regular expression. Suppose if we have the following
description
This would mean an object with html tag as INPUT and name starting with txt. Now
actually that “.*” was considered as regular expression. So, if you want the property
“name” not to be recognized as a regular expression then you need to set the
“regularexpression” property as FALSE
This is how of we create a description. Now below is the way we can use it
Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”
When we say .WebEdit(obj_Desc) we define one more property for our description
that was not earlier defined that is it’s a text box (because QTPs WebEdit boxes map
to text boxes in a web page).
If we know that we have more than 1 element with same description on the page
then we must define “index” property for the that description
Now the html code has two objects with same description. So distinguish between
these 2 objects we will use the “index” property. Here is the description for both the
object
We can use the same description for both the objects and still distinguish between
both of them
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”
When I want to refer to the textbox then I will use the inside a WebEdit object and
to refer to the radio button I will use the description object with the
WebRadioGroup object.
But if we use WebElement object for the description then we must define the
“index” property because for a webelement the current description would return
two objects.
[1]"If you plan on continuing to run tests in the earlier versions of QuickTest
Professional, you should make a copy of the test before opening it in the newer version. If
you save the script in the new version, the format may not be compatible with the earlier
version.
Example: If you will be running the tests in both QuickTest Professional 8.2 and 9.0, do
not convert and save the test when it is opened in QuickTest Professional 9.0. Tests
opened and converted to the QuickTest Professional 9.0 format cannot be opened in
QuickTest Professional 8.2"
Session Objectives:-
[c]- We can define a Environment variable that can be accessed from any action in the
test
Environment Variables are two types
Internal
External
Internal Environment variables are defined in our local test and the variables can be
accessed from any action in the current test.
Example
The following example creates a new internal user-defined variable named MyVariable
with a value of 10, and then retrieves the variable value and stores it in the MyValue
variable.
Syntax :
Setting the Value
Environment.Value("MyVariable")=10
Retrieving the Value
MyValue=Environment.Value("MyVariable")
External Environment variables are defined in an External File and the variables can be
accessed from any action in any Test.
Example
The following example creates a new internal user-defined variable
The environment variable file must be an XML file using the following syntax:
<Environment>
<Variable>
<Name>This is the first variable's name</Name>
<Value>This is the first variable's value</Value>
</Variable>
</Environment>
To Load the External File in our Current Test the following syntax is used.
Environment.LoadFromFile(Path of the XML File)
To use the loaded Environment variables in the current test, we use the following
statement.
LocalVariable=Environment.value(“Variable Name”)
In QTP 6.5 Environment variables are maintained in .INI files instead of XML files
Typical Architecture of a .INI file is….
[Environment]
Name=“John”
Age=26
[a]-Regular expressions enable QuickTest to identify objects and text strings with
varying values.
Define a regular expression by entering the regular expression syntax for the string in the
value box in the Constant Value Options dialog box or the Parameter Options dialog box.
Instruct QuickTest to treat the value as a regular expression by selecting the Regular
Expression check box.
A regular expression is a string that specifies a complex search phrase.
Some of the regular Expressions are –
Using the Backslash Character ( \ )
Matching Any Single Character ( . )
Matching Any Single Character in a List ( [xy] )
Matching Any Single Character Not in a List ( [^xy] )
Matching Any Single Character within a Range ( [x-y] )
Matching Zero or More Specific Characters ( * )
Matching One or More Specific Characters ( + )
Matching Zero or One Specific Character ( ? )
Grouping Regular Expressions ( ( ) )
Matching One of Several Regular Expressions ( | )
Matching the Beginning of a Line ( ^ )
Matching the End of a Line ( $ )
Matching Any Alphanumeric Character Including the Underscore ( \w )
Matching Any Non-Alphanumeric Character ( \W )
Combining Regular Expression Operators ()
Example :
If a website is generating a Command Button during the run time. In this case Object
repository can not have a entry of it. So by using Descriptive Programming we can
handle this situation.
Ways to do Descriptive programming
List the set of properties and values that describe the object directly in a test statement
Add a collection of properties and values to a Description object, and then enter the
Description object name in the statement.
Syntax:
Description.Create()
3.Library Files:-
These are the re-usable scripts that can be used for automation.
Advantages of Library Files
Maintainability
Reusability
Security
[1].
The following script stored in X machine in folder say SMOKETEST :
Sub_script:
Main_Script:
This Main_Script call action Sub_Script.
From machine X, i copyed folder SMOKETEST including shared object repository to
my machine.
When i run Main_Script (which is copied in my machine), i got the following error
message
"Action not found" while running Sub_Script action
if i comment code for Sub_script, then i call same action i.e. Sub_Script.. .it works fine.
But why it is not working for 1st time...is there any setting i have to do it ?
[2]
Environment Variables:-It can be accessed from any action in the test
means the variable can be accessed from any action in the current test.
means if we want a value which is constant and we want to use in entire test
then we assign that value into a variable and add this variable as a EnvironmentVariable.
Advantage:This is useful to reduce the time for assigning the constant value every time.
Environment Variables Creation:-for ex,if we want a value which is 10.
and we used this value for somany times,then we need to assign this value into
environmentvariable.
-Go to NotePad and write Environment.Value("variable name")=10 and save it as a name
with .vbs extension.
Then go to QTP Tool-Test tab-select test settings-select Environment tab and past the file
which u saved as a .vbs extention.
so how we use this variable,dont worry i am sending a document,u just go through it u
will understand everything.
or
.Setting the value:Environment.value("variable")=10 which we done above.
.Retrieving the value within the script:variable=Environent.value("variable")
Note:-
When we use Environment("Param1").value then QTP expects the environment variable
to be already defined. But when we use .
Environment.value("Param1") then QTP will create a new internal environment variable
if it does not exists already. So to be sure that variable exist.
in the environment try using Environment("Param1").value.
[5]-any one can help me in this How can we add window menu objects to
Object Repository in QTP with out recording.?
[6] Can someone please tell to count the total number of items in a WebList?
[9]- How can we get the snapshot for the failed and passed
status through QTP Script.?
Ans:
Tools----->Options- ----->Run tab
There is option called "save step screen capture to results" it got 4 options..... .
1) Always 2)on errors 3)on errors and warnings 4)Never.
Choose whatever you want.
[10]- How to get the consolidated Test Results in QTP (is it possible via Script)?
Ans:
Tools----->Options- ----->Run tab
Select check box for the option" view test results when run session ends."
when every time you run the script, at the end of run session, a detailed test results will be
displayed.
[11]- How can we convert the snapshots and test results into
PDF .?
Connect to quality center from QTP, evan you can connect to quality from test results.
Quality center generates very nice detailed test report in word format.
Later if you want you can convert it into pdf.
[12]-While selecting Priority and severity of bugs. Keep in consideration
Problem in front-end of application due be any reason is equal proportion to select ing
the priority marks of bug. Big problem in front-end of application give reason to set high
priority.
And Problem in Backend of application due to any reason which reflect on front end of
application is equal proportion to select ing severity of Bugs.
Suppose there is Data grid in a form of application which has to shows details of all paid
users till date. But it only show paid users which has registered after the date of 12/06/06.
Because here the data is show ing ( Front-end) but wrong database query is used
(Backend). So Priority is medium. But severity is high.
Priority of Bugs can change according to Time remain for Testing the application but
not severity.
[13]- How can I copied application data paste in to notepad through QTP.
QTP has a separate ADD-IN for Oracle, do check if it is installed on your system and
enabled when u run QTP. I think this should help.
Here is a piece of code QTP recorded for a very same function on our application. .
This code won't run later, it navigates the application properly at menu level but fails at
filed level, The error message it gives is "Verify that parent properties match an object
currently displayed in your application"
2nd recording... ...
[14]- Can some one give me list of Low priority and high severity Bugs and high priority
and low severity bugs.
a good example for low priority & high severity bug is a deffered bug, which cannot be
fixed in the current release (fatal erro).
Amdocs' main products are centered around Integrated Customer Management (ICM);
the components include a complete product and service suite. Other products include
CRM systems (such as Clarify, including ClearSales) , Amdocs 6, Self Service, Ensemble
and Enabler.
AMDOCS generates billing data for most US phone companies and is able to provide
detailed logs
SERVICES
They include:
Amdocs Customer-Centric Service Assurance Solution
Amdocs Order-to-Activation Solution
Amdocs Customer Intent-Driven Contact Center Solution
Amdocs Qpass Digital Commerce Management Solution
Amdocs Convergent Rapid Launch Solution
Amdocs Next-Generation Convergent Billing Solution
Amdocs Multi-Channel Self-Service Solution
(Amdocs or Samson or CSM or CRM or Billing shows the changes that take place in
the application done by the Customer care will be seen in Samson database at the
same time its seen in SQL and TOAD databases.)