DESCRIPTIVE PROGRAMMING IN QTP (UFT)

Slides:



Advertisements
Similar presentations
Tutorial 6 Creating a Web Form
Advertisements

1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
Tests Creation. Using the following QuickTest components  Designing Tests  Keyword View  Test Objects  Active Screen  Checkpoints  Object Property.
Information Technology Center Hany Abdelwahab Computer Specialist.
Python and Web Programming
Tutorial 14 Working with Forms and Regular Expressions.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Creating Web Page Forms
Automation Repository - QTP Tutorials Made Easy The Zero th Step TEST AUTOMATION AND QTP.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Automation Testing- QTP Rajesh Charles Batch No: Date: jan
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
XP Tutorial 14 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Tutorial 14 Working with Forms and Regular Expressions.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
Tutorial 10 Programming with JavaScript
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
1 A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 4 JavaScript and.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Introduction to CSS. What is CSS? CSS ("Cascading Style Sheets") determines how the elements in our XHTML documents are displayed and formatted. By using.
Slide 1 Controls v Control naming convention –Label: lblName –Command Button: cmdName –Text Box: txtName.
Quick Test Professional 9.2. Testing Process Preparing to Record Recording Enhancing a Test Debugging Running the Test and Analyzing the Results Reporting.
Perfecto Mobile Automation
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Tutorial 6 Creating a Web Form
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
QTP. Saturday, July 09, 2016Ashish Kumar Srivastava2 What is Automation- Test Automation is the use of software to control the execution of tests & the.
Automation Testing- QTP Rajesh Charles Batch No: Date: jan
Introduction to EBSCOhost
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
HTML Extra Markup CS 1150 Spring 2017.
Introduction to.
JavaScript, Sixth Edition
14 Shipping Time App Using Dates and Timers
In this session, you will learn to:
Chapter 6 JavaScript: Introduction to Scripting
Creating Oracle Business Intelligence Interactive Dashboards
Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser.
Creating LOVs and Editors
Learning the Basics – Lesson 1
Lawson System Foundation 9.0
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
Intro to PHP & Variables
Prepared ByAshish Kumar Srivastava
Tutorial Introduction to support.ebsco.com.
More Selections BIS1523 – Lecture 9.
Chapter 27 WWW and HTTP.
WEB PROGRAMMING JavaScript.
Finding Magazine and Journal Articles in
Cascading Style Sheets (Introduction)
PHP.
T. Jumana Abu Shmais – AOU - Riyadh
Cascading Style Sheets (Introduction)
QTP: Object Repository, Descriptive Programming and Beyond
Building ASP.NET Applications
Introduction to Programming and JavaScript
MIS 3200 – Unit 6.1 Moving between pages by redirecting
Using Microsoft Outlook: Outlook Support Number
Web Programming and Design
Tutorial Introduction to help.ebsco.com.
SPL – PS2 C++ Memory Handling.
Presentation transcript:

DESCRIPTIVE PROGRAMMING IN QTP (UFT)

Introduction Also known as Programming Descriptions Provides a way to perform operations on objects (mostly dynamic) that are not present in OR

When and where to use DP? Handling dynamic object property Using external functional library When OR is high When Application is not ready yet Suppose we have a web application that has not been developed yet. In that case OR wont work. But if we know the descriptions of objects that will be created, we can start off the scripts. when several identical objects need same operations On same Page Suppose we have 15 text boxes on a webpage and there names are in the form txt_1, txt_2 … and so on. Now adding all these 15 objects in OR would not be a good approach. We can simply go for descriptive programming On Different Page Suppose we have 3 navigation buttons on a webpage . For 10 pages flow, it would mean adding 30 objects in OR . which is not a good approach.. We can simply go for descriptive programming.

How to write DP? DP is not limited to a particular technology. It can be used across technologies and add-inns in QTP. 2 ways 1. By giving description in the form of string arguments (Inline DP or Static DP) 2. By creating properties collection object for the description (Dynamic Descriptive Programming)

Inline DP Syntax: Test Object( “PropertyName1:=PropertyValue1”, “PropertyName2:=PropertyValue2”………… “PropertyNameN:=PropertyValueN” Where, Test Object  is the test object class. This could be Browser, Web Edit, WebRadioGroup etc. PropertyName:=PropertyValue is the test object property-value pair. Note: “propertyName1:=PropertyValue1” is correct. “PropertyName1 :=PropertyValue2” is incorrect. space

DP statements for demo flight reservation application QTP doesn’t record any property for a browser. Browser shown above can be written as Browser(“micclass:=Browser”) QTP doesn’t record any property for a Page. Page shown above can be written as Page(“micclass:=Page”)

When you object spy username textbox you get, Web Edit object shown above can be written as WebEdit(“type:=text”,”name:=us erName”, “html tag:=INPUT”)

Combining all these statements together, DP statement Equivalent to Normal Recorded Statement is Browser(“micclass:=Browser”).Page(“Micclass:=Page”).WebEdit(“typ e:=text”,”name:=userName”,”html tag:=INPUT”).Set “Mercury”

Dynamic Descriptive Programming By creating properties collection object for the description. Example: Dim oDesc ‘Declare an object variable Set Odesc=Description.Create ‘Create Empty Description oDesc(“type”).Value=“text” oDesc(“name”).Value=“userName” oDesc(“html tag”).Value=“INPUT” So previous INLINE DP statements would look like, Browser(“micclass:=Browser”).Page(“Micclass:=Page”).WebEdit(oDesc).Set “Mercury”

regular expression in dp Regular expression is used in a checkpoint. It enables to quick test to identify the objects and text strings. We can use regular expression for 1. Defining property values of an object in dialog boxes or programmatic description 2. parameterizing step 3. creating check points with varying values Characters and sequence that can be used in QTP : (click) Some Symbols: *------> to complete text and characters \d----> for a digit \s----> for a space \S----> for a string . ------> for 1 char [ ]-----> Range Operator

examples of regular expression 1. first number/digit should come as 5,6,7 and 2nd digit as 2,3,4 Regular Expression:[5-7][2-4] 2. To validate a number of length 10 digits provided that digits should be between 2-9 Regular Expression:[2-9]{10} 3. Any number of length 5 Regular Expression:\d{5} 4. for number of digits of any length Regular Expression: d+ $223.20==> \$\d+\.\d{2} (d+ for number of digits of any length) $223.20===>\$[1-9][1-9][1-9]\.\d{2}

title=" Google ajkdahalhduiakah” Regular expression: Google.* time=12:53 PM Regular expression : \d{2}\:\d{2}[ PM or AM]{2} Or \d{2}\:\d{2}[ P or A]M{2}

using regular expression in dp Dim oDesc ‘Declare an object variable Set Odesc=Description.Create ‘Create Empty Description oDesc(“type”).Value=“text” oDesc(“name”).Value=“userName\d\d\d” ‘(instead of writing userName123) oDesc(“html tag”).Value=“INPUT Note: If you wish to turn off regular expression, then oDesc(“name”).RegularExpression=False

using ordinal identifier in dp There are 3 ordinal identifiers in QTP Index Location Creation Time why ordinal identifiers? For example, when multiple browsers are opened, we can identify which browser is opened first, with the help of creation time or setting index. Browser(“micclass:=Browser”).Page(“Micclass:=Page”).WebEdit(“type:=text”, “name:=userName”,”html tag:=INPUT”, “index:=0”).Set “Mercury” Browser(“micclass:=Browser”).Page(“Micclass:=Page”).WebEdit(“type:=text”, “name:=userName”,”html tag:=INPUT”, “index:=1”).Set “Mercury”

difference between class vs classname vs micclass When we object spy some class(say button),it shows two different properties Classname and Class. Class Name is the basic essence of that object. If Class Name gets changed the object itself would get changed. Hence, an object of type button will always be shown as WebButton under Class Name, a hyperlink would always be shown as Link, a browser object would always be shown as Browser and so on. A point to note here is that, while object spy shows the property as Class Name, the same property should be written as micclass while using Descriptive Programming. For ex: Browser(“micclass:=Browser”).Page(“micclass: =Page”).WebButton(“micclass:=WebButton”,”P ropertyName:=PropertyValue”).Click Note: micclass Mercury Interactive Class Content

what is: gettoproperty Returns the value of the specified identification property from the test object description. Example :1 (when object is in Object Repository) SystemUtil.Run "iexplore.exe" Browser("Google").Navigate http://www.yahoomail.com/ abc = Browser("Google").Page("Yahoo! Mail: The best").WebEdit("login").GetTOProperties ("name") msgbox abc Example 2: (with descriptive programming) Set obj = Browser("name:=Sign in to Yahoo!").Page("title:=Sign in to Yahoo!").WebEdit("html id:=username") msgbox obj.GetTOProperty("html id")

what is: getroproperty Returns the current value of the specified identification property from the object in the application. Example –'The following example uses the GetROProperty method to retrieve ‘the Y coordinate of the AcxCheckBox object relative to the top left 'corner of the screen. Sub GetROProperty_Example() Set Value= Browser("Flight").Page("Flight").AcxCheckBox("LogicalName").GetROProperty("abs_y") End Sub

what is: settoproperty The SetTOProperty changes the value of a test object property. Changing the property doesn't affect the OR or Active Screen, but just the way QTP identifies the object during runtime. Actually, this changes the properties of the temporary copy of the object stored in RAM by QTP. Any changes you make using the SetTOProperty method apply only during the course of the run session, and do not affect the values stored in the test object repository. Example: Set obj = Browser("name:=Sign in to Yahoo!").Page("title:=Sign in to Yahoo!").WebEdit("html id:=username") msgbox obj.GetTOProperty("html id") 'Would retrieve the object html id from the test object description, whether it's in the OR or DP defined 'Now we set the name property obj.SetTOProperty "name", "loginzzzzz"'And retrieve it msgbox obj.GetTOProperty("name")

Thank you…!!