http://safsdev. sourceforge. net/DataDrivenTe stAutomationFram eworks.
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. 2.If parameterization is done in the data sheet it is applicable to that action means particular to that test only where as if parameterization is done by environment variable it is applicable to all of the test and thus the variable will be as global.
The framework requires the creatio of Repository files,Recovery Files,Library Files(Reusable Functions or userdefined functions),XLS files 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 settingsselect 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 For restricting functions of the library to specific Actions For loading libraries depending upon conditions at run-time. ExIf Condition1 then ExecuteFile “C:\File1.vbs” Else ExecuteFile “C:\File2.vbs” End If
For declaring Global Variable, Functions, classes etc… Add all global variables to a VB Script file and specify it in settings.
which u stored in a folder"). ExecuteFile “C:\Documents and Settings\tarun_lalwani\Desktop\Demo.vbs” 3.XLS files:--the functionality(data whithin a fields) of the app under test(AUT) is documented in a Data Table. This DataTable contains testdata for a particular screen fields and this datatables are loaded onto scripts manually. advantage:-so whenever the app data is changed,we dont want to change the script just we have to change the data whithin the datatable. i am sending a script which contains how we develop datatable whithin a script. 4.Recovery Files:--Recovery files are created using "Recovery Scenario Manager". These files r used for an unexpected event or error occur whithin a run session and the recovery operation is neccessary. At first we understand the app functionality and we want to guess that what type of errors are occur during the script execution. ex:-some times if there is misspeled data is entered whithin a field then a pop-up window will open and says "enter appropriate data ",so we want to create file for this using "Recovery Scenario Manager",in this 1]trigger event 2]Recovery Operation and3]post recovery test run. After this we enter with "scenario name"and save this in "Recovery_files"folder which we want to create at earlier stage like re_uasable_func folder. Then select Test tab-Test Settings-Recovery tab and add recovery file which is saved in "Recovery_files"folder with scenario name. Next execute this file whenever u want whithin a script using few functions like: -declare a variable(ex-rep) variable=Recovery.GetScenarioPosition(Scenario File,Scenario Name) Recovery.Set Scenario Status(variable,Status) Status=True or False Recovery.Activate Then this file is executed whenever this perticuler error occur. and also use OnErrorResumeNext function also used.just got to built-in functions. 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 object on which you use SetTOProperty function. Can i change properties of a run time object? No (but Yes also). You can use GetROProperty("outerText") to get the outerText of a object but there is no function like SetROProperty to change this property. But you can use WebElement().object.outerText="Something" to change the property. 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 the photograph. So it kind of PI (Programmed intelligence) not AI. When should i use SMART Identification? Something that people don't think about too much. But the thing is that you should disable SI while creating your test cases. So that you 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 When and Why to use Descriptive programming? 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 Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page. 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. How to use Descriptive programming?
There are two ways in which descriptive programming can be used By creating properties collection object for the description. By giving the description in form of the string arguments. By creating properties collection object for the description. To use this method you need first to create an empty description Dim obj_Desc ‘Not necessary to declare Set obj_Desc = Description.Create Now we have a blank description in “obj_Desc”. Each description has 3 properties “Name”, “Value” and “Regular Expression”. obj_Desc(“html tag”).value= “INPUT” 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 obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt.*” 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 obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt.*” obj_Desc(“name”).regularexpression= “txt.*” 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 Consider the HTML code given below
<INPUT type=”textbox” name=”txt_Name”> <INPUT type=”textbox” name=”txt_Name”> 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 For 1st textbox: obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name” obj_Desc(“index”).value= “0” For 2nd textbox: obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name” obj_Desc(“index”).value= “1” Consider the HTML Code given below: <INPUT type=”textbox” name=”txt_Name”> <INPUT type=”radio” name=”txt_Name”> 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. Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” ‘Refers to the text box Browser(“Browser”).Page(“Page”).WebRadioGroup(obj_Desc).set “Test” ‘Refers to the radio button 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. "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:1.Global Data Maintenance in QTP:2.Handling Dynamic Objects:3.Library Files:1.Global Data: – Data accessible across the script. Ways to maintain Global Data in QTP [a]-Global Datasheet:[b]-Action Parameters [c]-Environment Variables [d]-Dictionary Object in Registry [a]- Global sheet enables to pass information between actions. Data stored in Global sheet is accessible through out all the actions Syntax : To Retrieve a value from Global sheet DataTable(“Column Name”,dtGlobalSheet) To Write a data into Global sheet DataTable.GlobalSheet.AddParameter "Time1", "5:45” [b]- You can output a value to an action or component parameter, so that values from one part of a run session can be used later in the run session, or be passed back to the application that call the test or component. Types of parameters Input Parameters Output Parameters Input parameters are used to pass values to the called action. Output parameters are used to return a value to calling action or component. We can set Input and Output Action Parameters in Action Properties Dialog box. Syntax : Parameter(Variable Name) [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 [d]-Sharing data using registry: The Dictionary object enables to assign values to variables that are accessible from all the actions where the Dictionary object is created. To use the Dictionary object, first add a reserved object to the registry in HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\ReservedObjects\) with ProgID = "Scripting.Dictionary". For example: HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\ReservedObjects\GlobalDictionary Once Creating a Dictionary Object to registry, It can be accessed from any Test and we can add or remove values to it. Example code goes like this : GlobalDictionary.RemoveAll GlobalDictionary.Add “Dept", “Marketing" Then you can retrieve the data from the Purchase Tickets action as follows: Dim CompareDate
CompareDate =GlobalDictionary.Item(“Dept") 2.Handling Dynamic Objects:Dynamic Objects : Objects that are having varying properties. Ways To recognize dynamic objects [a]-Regular Expressions [b]-Parameterizing Object Repository [c]-Using Environment Variables [d]-Descriptive Programming. [a]- Regular Expressions: [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 () [b]-Parameterizing Object repository: Pass varying values to Object Repository from DataTable [c]- Environment Variables to Handle Dynamic Objects: Pass Environment parameter value to Object Repository to handle Dynamic Objects [d]- Descriptive Programming: All programmatic description property values are automatically treated as regular expressions.
Instruct QuickTest to perform methods on objects without referring to the object repository or to the object’s name. To do this, provide QuickTest with a list of properties and values that QuickTest can use to identify the object or objects on which we want to perform a method. Programmatic descriptions enable you to create temporary versions of test objects to represent objects from the application. Perform operations on those objects without referring to the object repository. 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() A Sample Descriptive program ….. SystemUtil.Run "C:\type.txt" Window("Text:=type.txt - Notepad").Type "happy days" Window("Text:=type.txt - Notepad").Type micAltDwn & "F" & micAltUp Window("Text:=type.txt - Notepad").Type micLShiftDwn & "S" & micLShiftUp Window("Text:=type.txt - Notepad").Close 3.Library Files:These are the re-usable scripts that can be used for automation. Advantages of Library Files Maintainability Reusability Security . 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 ?
 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. - Can anyone tell me how to recognize a link using > Descriptive programming in QTP. > I have used href and htmltag attributes but still it doesnt recognize. Describe the link object using its mic class and class value also. -any one can help me in this How can we add window menu objects to Object Repository in QTP with out recording.?  Can someone please tell to count the total number of items in a WebList? x = Browser().Page( ).weblist( ).getroproperty( "items Count") (or) ItemsCount=Browser( "Browser Name").Page( "Page name").Weblist( "Weblist name").GetROpropert y(ItemsCount) msgbox ItemsCount -I do not have Quality center on my computer but I have Testdirector Do you know if there is any way that I could run batch tests with QTP and Testdirector?
I was trying to run some tests with "Test Batch Runner" And its running all the tests but I was able to only view the last result sheet. How can I view the results on all the tests in the batch? First you need to install quality center in your computer. Then open the quality center,it opens in web browser. Copy that URL and use it in QTP while connecting to quality center.Then click connect button. Later give the domain name, project name,user name and password. Note: if you are using trial version of quality center, Then domain name is default Project name: Qc-demo username:Alice_ qc password: No need of password for this username. When i cliked on "connect" without giving anything in the server feild its gave a message "full server url path is required" I didnot know what url do I need to give -How can we get the Snapshots via Script? we take screen shots during Runtime by using this option CaptureBitmap & it is saved "res" folder of the QTP saved file syntax: object.CaptureBitma p "file_name", "option" (1) file_name i.e .bmp or .jpg (2) 0 or 1 i.e to over the present file or not Ex: Desktop.CaptureBitm ap "Desk.bmp",1 Note: To know the Object name: QTP->ScriptView- >press F7 .... - 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. - 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. - 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. -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. - 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. My company's applications are developed on Oracle Forms and Reports While recording scripts on these apps, QTP records the scripts sometimes as JAVA, sometimes as Oracle Here is a piece of code QTP recorded for a very same function on our application. . Code from 1st recording... ... OracleFormWindow( "Menu Explorer").OracleTr ee("OracleTree" ).Select "fulfillmentSCE->Bookings" OracleFormWindow( "Menu Explorer").OracleTr ee("OracleTree" ).Expand "fulfillmentSCE->Bookings" OracleFormWindow( "Menu Explorer").OracleTr ee("OracleTree" ).Select "fulfillmentSCE->Bookings->Export" OracleFormWindow( "Menu Explorer").OracleTr ee("OracleTree_ 2").Activate "Shipment Entry" OracleFormWindow( "Booking Screen").OracleText Field("OracleTex tField"). OpenDialog 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... ... JavaWindow(" TST v760").JavaInternal Frame("Menu Explorer").JavaTree ("DTree") .Select "fulfillmentSCE; Bookings" JavaWindow(" TST v760").JavaInternal Frame("Menu Explorer").JavaTree ("DTree") .Expand "fulfillmentSCE; Bookings" JavaWindow(" TST v760").JavaInternal Frame("Menu Explorer").JavaTree ("DTree") .Select "fulfillmentSCE; Bookings; Export" JavaWindow(" TST v760").JavaInternal Frame("Menu Explorer").JavaTree ("DTree_2" ). Select "Shipment Entry" JavaWindow(" TST v760").JavaInternal Frame("Menu Explorer").JavaTree ("DTree_2" ). Activate "Shipment Entry" JavaWindow(" TST v760").JavaInternal Frame("Booking Screen").JavaEdit( "VTextField" ).SetFocus - 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). i kno d example for high priority and low saviority:its like in the case of a notepad , suppose when we click on save button the file gets saved but it gets saved at two locations so this problem will be high priority for developers because memory is getting wasted in it while it will be of low saviority for testers bcoz they have tested and verified that the files gets saved.
Amdocs is a provider of software and services for billing and CRM systems. Its clients are primarily focused on the public sector and telecommunications, including such "Tier1" players as Sprint-Nextel, Cingular, Vodafone, T-Mobile. 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
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 Citrix connection center or Amdocs Table. (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.) Central point of connection to all environments. We created this site as a central point of connection to all of your frequently used environments. No more icons to worry about. You can access this page from any computer with IE 5.5 installed, anywhere on the network. Click a link on the left to navigate, and then below to launch the application. The application will run in a separate window, allowing you to connect to multiple environments simultaneously. Select PET Environment on the right hand side of the page Opens up the Environment page , Select the environment according to the environment in which testing is taking place Takes the operator to Samson Main Login Page Put in ur Login mostly user id is ur last 4 digits of ur social or last 4 of ur desk ph no Ttakes u to central login page Different applications are in the table below for just information Select CSM to check the changes u have done in the web applications during testing Customer service management page opens up Select SELECT icon Select Ban window opens Select BAN from the drop down list and put in the Ban number in the NO window
( BAN is the Specific no given to a customer under which no of different ph nos will be registerd for the customer.) Select RETRIVE Gives the customers details Double click on the details it opens up the details on the customer in detail. Can see the Financial summery ,Ban Profile,Agreement,Features,Profile of the customer For showing the changes in Samson we need to show it in FULL BILL INDICATOR For FBI select Page Options from the top of the page Select Paperless Bill from the drop down box Gives the FBI window which should be taken snap shot of We can Suspend, Cancel and Rrestore the customer’s Specific Ph No from the account from Samson This is more than enough to know about AMDOCS or SAMSON or CRM or CSM or Billing all r same Managers too don’t know more than this