Automation Testing- QTP Rajesh Charles Batch No: Date: jan

Slides:



Advertisements
Similar presentations
Integrated Business Applications with Databases (D3) Jenny Pedler
Advertisements

ISOM3230 Business Applications Programming
Tutorial 8: Developing an Excel Application
AE6382 VBA - Excel l VBA is Visual Basic for Applications l The goal is to demonstrate how VBA can be used to leverage the power of Excel u VBA syntax.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
JavaScript Part for Repetition Statement for statement Cpecifies each of the items needed for counter-controlled repetition with a control variable.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 06.
Automating Tasks With Macros
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
September 2009 QTP Automation Framework. Objective  Introduction to Automation  Benefits of Automated Testing  Automated Testing Process  Introduction.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Christopher Guertin VAMC – West Palm Beach, FL 1.
Other Features Index and table of contents Macros and VBA.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
CHAPTER 6 Loop Structures.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running o Stored in.
What is QTP ► QTP stands QuickTest Professional ► It is an automated testing tool provided by HP/Mercury Interactive ► QTP integrates with other Mercury.
IE 212: Computational Methods for Industrial Engineering
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
1 Chapter 9 Writing, Testing, and Debugging Access Applications.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Using Visual Basic for Applications (VBA) – Project 8.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Functions.
Outline Software and Programming Program Structure Tools for Designing Software Programming Languages Introduction to Visual Basic (VBA)
CPS120: Introduction to Computer Science Decision Making in Programs.
Chapter 16: Programming Structures Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
I Power Higher Computing Software Development Development Languages and Environments.
Chapter 16: Programming Structures Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Tutorial 101 Variable Arrays A group of variables that have the same name and data type and are related in some way Can have as many as 60 dimensions.
Visual Basic CDA College Limassol Campus COM123 Visual Programming 1 Semester B Lecture:Pelekanou Olga Week 5: Useful Functions and Procedures.
Quick Test Professional 9.2. Testing Process Preparing to Record Recording Enhancing a Test Debugging Running the Test and Analyzing the Results Reporting.
Controlling Program Flow with Decision Structures.
Perfecto Mobile Automation
National Diploma Unit 4 Introduction to Software Development Procedures and Functions.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
Automation Testing- QTP Rajesh Charles Batch No: Date: jan
VBA - Excel VBA is Visual Basic for Applications
VBA - Excel VBA is Visual Basic for Applications
JavaScript: Functions
Introduction to Scripting
JavaScript: Functions.
Microsoft Access Illustrated
Course Name: QTP Trainer: Laxmi Duration: 25 Hrs Session: Daily 1 Hr.
Chapter 10 Programming Fundamentals with JavaScript
VISUAL BASIC.
Exploring Microsoft Excel
PHP.
CS285 Introduction - Visual Basic
CodePainter Revolution Trainer Course
QTP Test Process
Tutorial 11 Using and Writing Visual Basic for Applications Code
Framework Anil
Presentation transcript:

Automation Testing- QTP Rajesh Charles Batch No: Date: jan-12-2014 Quality Assurance Automation Testing- QTP Rajesh Charles Batch No: Date: jan-12-2014

Agenda (Complete Course) Introduction Testing Methodologies Manual Testing Practical Workshop Automation Testing Performance Testing SQL for Beginners Quality Center UNIX for Beginners Interview Practice and Mock Interview

Agenda (Today’s Class) What is Automation Difference between Manual testing and Automation Testing What is Codding Language (VB Scripting) Introduction to QTP Practical Workshop

Software testing – Automation Testing Automated software testing is a process in which software tools execute pre-scripted tests on a software application before it is released into production. Pre-scripted http://searchsoftwarequality.techtarget.com/definition/automated-software-testing

Difference between Automation and Manual Testing Automation Testing 1 Time consuming and tedious: Since test cases are executed by human resources so it is very slow and tedious. Fast Automation runs test cases significantly faster than human resources. 2 Huge investment in human resources: As test cases need to be executed manually so more testers are required in manual testing. Less investment in human resources: Test cases are executed by using automation tool so less tester are required in automation testing 3 Less reliable: Manual testing is less reliable as tests may not be performed with precision each time because of human errors. More reliable: Automation tests perform precisely same operation each time they are run. 4 Non-programmable: No programming can be done to write sophisticated tests which fetch hidden information. Programmable: Testers can program sophisticated tests to bring out hidden information

What is Codding Language – VB Script VBScript, modeled on Visual Basic, is an active scripting language developed by Microsoft VBScript is a light programming language that uses the Component Object Model to access elements of the environment within which it is running. Component Object Model COM or 'Component Object Model' is a method by which an application exposes its functionalities to other applications & programming languages using a set of methods and functions. Lets Execute a VB script VB Scripting: https://www.youtube.com/watch?v=MDdYWDdpeYE

VB Script Integer: Whole numbers are all natural numbers including 0 e.g. 0, 1, 2, 3, 4… Integers include all whole numbers Rational Number: Rational number but not an integer. All rational numbers belong to the real numbers String: Strings, which are widely used in VB programming, are a sequence of characters Decimal: Decimal Format is a concrete subclass of Number Format that formats decimal numbers Variable: In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Eg; a=100 a=300 Where “a” is the variable VB Scripting: https://www.youtube.com/watch?v=MDdYWDdpeYE https://www.youtube.com/watch?v=d7AjlxV0Ci8

What is Codding Language – VB Script What is VB? Why VB in QTP Variables and Constants Msgbox, Inputbox, vbCRLF Running Scripts Concatenation operator Managing long Strings Run from Step and Run to Step For and While Loops VB Scripting: https://www.youtube.com/watch?v=MDdYWDdpeYE

VB Script - PROCEDURES Procedure is a set of statements that perform a specific task VB script of 2 types of Procedures Function Procedures Sub Procedures Function Procedures A series of statement enclosed within Function and End Function Can perform an action and return a value Can take arguments that are passed to it by a function call Without arguments, Functions must include an empty set of parentheses () Returns a value by assigning a value to its name Function Procedures in VB script of 2 Types User Defined Functions In Built Functions

VB Script – User Defined Function Syntax for Function : To write a Function Function functionname (parameters, if any) Your code here …… End Function Lets do an example Syntax for Function : To call a Function Call functionname 1. Use Call only when we don’t want the return value of the function 2. When Call is used the arguments should be put in parentheses OR functionname 1.if the return value is going to be stored in a variable then argument should be parentheses 2.If return value is not stored then argument should not be in parentheses

VB Script – User Defined Function A Function without parameter (no input) A Function with one parameter (input to a fn) A Function to add 2 numbers with parameters and Print the result inside the Function Change the above Function to capture the return value outside the Function and Display Modify the grade program using Function

VB Script – Advantages of Function Code Reusability Easier to debug Easy to Use Recursive call is possible Easy to manage and change Reduces the number of line of code in the program

VB Script –Function Exercises Write a function without any parameter. Put a message box in it which should display your name. Call the function Write a function to multiply 3 numbers. Do not pass the numbers in the function call. Declare and initialize the variables with numbers within the function. Write the msgbox to display the result within the function. Write a function to divide 2 numbers. Pass the numbers in the function call. Write the msgbox to display the result within the function Write a function to subtract 2 numbers. Pass the numbers in the function call. Capture the results of the function returns outside the function. Display the results outside the function Put the above function in a function library. Pass the numbers from the test and get the results back into the test.

VB Script – Array Function Array – To create an array IsArray – Tells whether a variable is an array Lbound – returns lower bound of an array Ubound – returns upper bound of an array Split – Splits or breaks a string into an array base on a delimiter Join – Joins an array into a string using a delimiter

VB Script – Exist Property Exits Property : Check whether the object currently exits in the open application Syntax: object.Exist(Timeout) If a timeout value is specified, QTP waits until it finds the object or until the timeout is reached. If the value 0 is specified, the property returns the True or False value immediately If no value is specified, the value specified in the Test Settings dialog box for the object synchronization timeout is used for test. The default is 20 seconds File  Settings  Run  Object Synchronization Timeout

QTP - Synchronization There will be situations where the application does not respond with the same speed of the test. For example For a progress bar to reach 100% For a button to become enabled For a window or pop-window to open These anticipated timing problems may cause the scripts to return inaccurate results. These problems can be handled by synchronizing the test Synchronization makes QTP wait until the application is ready for the next step

QTP - Synchronization Wait Statement Inserting a Synchronization point (WaitProperty): Insert  Synchronization point (enabled only while recording) Can even be written in the Expert View Using Exist property 3. When working with tests, we can increase the default timeout setting (20secs) for a test to instruct QTP to allow more time for objects to appear File  Setting  Run  Object Synchronization Timeout

QTP – Data Driven testing Data-driven testing is a framework where test data, expected result, actual result, status etc is put in and read from outside of the test script Source for Data can be Database, Excel Files, DataTable, Notepad files, XML files etc Reading of the data files and rest of the code and logic is written in the test script Test scripts are built in such a way that they should work for different sets of data without any changes.

QTP – Data Driven testing

QTP – Data Driven testing – Data Table A QTP Test consists of Actions By default a test contains one Action (Action1) A new test in QTP by default has one Global sheet and one local sheet (of Action 1) in the DataTable Every new Action added to the test will come with a local sheet of it s own The name of the Action will be the name of its local sheet More sheets to a test can be added programmatically Global, Local and all other sheets can be accessed by any Action (Data in any action can be used in any other actions) By default, one row is enabled in the Global and Local sheets More rows get enabled as data is entered into the respective sheets View  DataTable

QTP – Data Driven testing – Data Table Every test by default runs for all rows enabled in the Global sheet This mean that number of rows enabled in the Global sheet will be the number of times the test runs To run the test for less iterations, settings have to be changed in the Test Settings File  Setting  Run Every action by default runs for one iteration This means that even if we have 3 rows of data in the Action (3 rows enabled) the Action by default will still run only once If we want to run the Action more than once or for all rows enabled in the sheet then setting have to be changed in Action Call Properties.

QTP – Data Driven testing – Data Table A simple login and logout of 3 users each with a different user id and password and check if the login is successful, How does it work if the data is in Action sheet and then in Global Sheet Login  Create 3 orders  logout Login  Create Oder  Logout. Create 3 orders In any application create 3 accounts. Put the data in an excel, import the data into QTP and export the result back to excel

QTP – CHECKPOINTS A checkpoint is a verification point that compares the expected value for specified properties with the current or actual value for those properties This enables us to identify whether the application is functiona

QTP – Descriptive Programming A way of creating scripts in QTP without the need for an OR

QTP – Descriptive Programming

QTP – Descriptive Programming The same process is followed in the DP approach too.. But the only difference is that there is no OR Because we don’t us OR in the Descriptive Programming approach, we have to provide all the information needed by the QTP to identify an object in the test statement. We will have to follow a particular syntax while creating scripts using DP approach Scripts cannot be recorded if DP has to be used Test in DP approach can be written in 2 ways Using Properties Collection object or Description object Using String Representation

QTP – Descriptive Programming Identify the objects needed for a test step Create a description object (properties collection object ) for all the object needed Then get the properties (mandatory and assistive, if needed and ordinal identifiers if needed identification of these objects from Tools  object Identification Use Object spy to get the values for these properties Then provide all the properties and their values including Object identifier needed for QTP to identify the objects to the Properties Collection Object Use the properties collection object to create the test statement or test step Note: Each description object had 3 properties “Name”, “Value” and “Regular Expression”.