qtp automation testing tutorial 1

of 37 /37
Copyright 2015 IT Professional Academy 1 Automation (QTP) Testing Course WELCOME

Upload: akash-tyagi

Post on 12-Apr-2017

339 views

Category:

Education


0 download

Embed Size (px)

TRANSCRIPT

Page 1: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 1

Automation (QTP) Testing Course

WELCOME

Page 2: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 2

About IT Professional Academy•Team of Highly Skilled Trainer with work Exp of 7+Y.

•Expertise in areas like Software Testing, Big Data, Linux-Unix, SAP BI as well as Software Development.

•Provides both Classroom and Online Classes.

•Training centers across multiple cities.

•Provides Job Assistance, Interview preparation, Mock Interviews, Resume Preparation.

Page 3: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 3

Salient Features:

Page 4: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 4

About Trainer:Exp: 7+ Y in Automation Testing

Technical Expertise:QTP, -UFT, Selenium, Excel Macro, Test Complete, PHP, HTML-CSS, PL-SQL

Batch Intro.

Page 5: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 5

Course Agenda

•Fluent in VB Script: variables, if-else, loops, arrays, Ddics, Objects, Functions etc•Excel Macro: Basics of Excel Macro•QTP-Basics: handling different web controls•QTP-Advanced: Excel, Data Tables, Mouse hovers, DB connections, DOM, AOM, COM•QTP-Framework Development: KW Driven, Data Driven, Hybrid, Function Driven and Action Driven

After end of the course, You will be comfortable in below things:

Page 6: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 6

Demo Agenda

•Introduction to Software Testing.•Introduction to Automation Testing•Automation Tools•QTP Vs Selenium•Introduction to VB script•Introduction to HTML•Introduction to Objects and Methods.•Introduction to QTP•Record and Play Back in QTP

Page 7: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 7

Day 1 Topics1) Automation General information    i. Automation definition    ii. Purpose of the Automation    iii. Benefits of the automation    iv. Which applications are suitable for automation    v. Which test cases are right candidates for automation    vi. Which are not right candidates for automation2) Automation Efforts Estimation    i. POC preparation    ii. CBA & ROI3) Automation Tool Types    i. Test management Tools    ii. Functional or Regression Tools    iii. Performance Tool

Page 8: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 8

Expectations

What are your Expectations with this course?

Page 9: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 9

Introduction To Software Testing•Purpose of Software Testing: To get Quality Product with out exceeding the set Cost.Live Example: Bank Lost $10000k in a month due to a defect.

•Methodologies in Testing: Water fall Vs Agile

•Software testing Life Cycle.

Page 10: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 10

Software Testing: Water Fall Model

Page 11: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 11

Agile: Focus on MVP

Page 12: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 12

Testing Pyramid: Agile

Page 13: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 13

Introduction To Automation Testing

“Automation is the use of tools and strategies that reduce human involvement or interaction in repetitive or redundant tasks.”

Page 14: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 14

Need for Automation Testing?•It Involves automating a manual process of testing.

•Ever shrinking schedule and minimal resources.

•Budget constraints.

•Save time for repetitive tasks performed during testing.

etc etc etc.

Page 15: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 15

Need for Automation Testing?Bottom Line:“So that machine works while you sleep so as to save

TIME&

MONEY.Budget is the Driving Factor for all automation efforts.

Page 16: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 16

Need for Automation Testing?ROI Example:

ROI = Benefit/Cost

Simple Rule: If Number of Automation Tester is more than Number of Manual Tester then ROI is not Achieved.

Page 17: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 17

Automation ROI

ROI= Benefit/Cost

If green line is not going down, ROI will never be achieved.

Page 18: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 18

Before you Automate..Ask two questions:

1. Shall you Automate?Should get some value out of it.“Automating Flow which will only be used once should not

be automated. Having said that, automating a flow which will be used only once but is important and not possible manually; should be automated.”

2. Can you Automate?Check Automation feasibility.“Before committing, always check if flow or AUT is feasible

to automate. Do not false commit.”

Page 19: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 19

Page 20: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 20

Advantages & Disadvantages of Automation Testing

Advantages Disadvantages

Saves Time High Investment in Tool and training

Cost Reduction Test Coverage

Reliable: Eliminating human error High man power requirement for test preparations.

Reusable

Better Quality Software

Page 21: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 21

Criteria For Automation Test ToolScope

Ease of Integration

Compatibility

Performance

Types of tests

Maintainability

Affordability

Page 22: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 22

QTP Vs Selenium-1QTP: It is commercial tool and hence it requires a license is expensiveSelenium: Its an open source tool hence it does not require license and is freeQTP: It is used for testing client-server applications. It can test web- based as well as desktop applicationsSelenium: Using Selenium only web applications can be testedQTP: QTP tests can only be developed in QTP IDESelenium: Selenium has the option of using wide range of IDEs like Visual Studio, Eclipse, NetbeansQTP: HP UFT only supports VB scriptSelenium: Selenium supports JAVA, .NET, Ruby, Perl, PHP, and many other programming languages

Page 23: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 23

QTP Vs Selenium-2QTP: HP UFT comes with built in object repository. Object repository development and maintenance is quite easy in HP ALMSelenium: Selenium dose not have such built in object repository, but object can be managed by using UI element user extensionQTP: HP UFT integrates with test management tool like HP Quality CenterSelenium: There is no such tool that integrates with SeleniumQTP: All types of dialog box is supported by itSelenium: It supports dialog box partiallyQTP: It supports different environments like SAP, Oracle, .NET but user need to purchase add-on license for themSelenium: It supports addition of plug-ins to include features that are not provided by core Selenium

Page 24: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 24

QTP Vs Selenium-3QTP: Automation testing is expensive due to licensing costSelenium: Web automation testing with Selenium incurs less costQTP: HP QTP offers very good technical supportSelenium: It has no official support, since it is an open sourceQTP: HP QTP supports only VBScript . Hence Object Oriented Approach to Test Automation becomes challengingSelenium: Selenium supports mature Object Oriented Language like JavaQTP: HP QTP is more user friendly and scripts are developed quickly.Selenium: It is a low level tool with less functionality. Script requires more time to develop and maintainQTP: Backward compatibility is powerful. Latest version of HP ALM supports code that was developed 5 years backSelenium: With new Selenium release the API changes. So Test Scripts need to be updated

Page 25: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 25

QTP Vs Selenium-4In Short it is similar to Buying a Laptop

QTP: Laptop with Windows 10 and useful Applications installed. Every thing up and Running.

Selenium: Laptop Case + Hard Disk+ Ram+ Linux CD + useful Applications CD. But Every thing for Free.

Page 26: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 26

Introduction to VB Script

VBScript designed to run on multiple platforms that use the ActiveX Scripting Interface.

VBA (VB for Applications)More sophisticated customization.Power user focus, natural upgrade, superb integration

Visual BasicBest tool for distributed client/Server solutions.Powerful, robust, scalable.

Page 27: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 27

What is VBScript?

•A subset of visual basic•The VBScript Code is case Insensitive.•Microsoft Visual Basic Scripting Edition brings active scripting to a wide variety of environments, including Web client scripting in Microsoft Internet Explorer and Web server scripting in Microsoft Internet Information Service (IIS).

Page 28: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 28

VB Script Example

1.VB Script Editor2.Create a .vbs File3.Create a simple Program for Addition and

Display the result.4.Calculator Program for Add, Subtract,

Multiply and Divide.5.Walk thorough the VB Script Code to

Automate IE.

Page 29: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 29

HTML Basics:1.Hyper Text MarkUp Language

2.It is the Implementation behind a Web page.

3.Do Inspect Element in Chrome to Check the HTML code of the Page.

4.You can alter the HTML Page by changing the text in the Chrome Editor.

5.HTML Tags and Attributes.

Page 30: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 30

HTML BasicsTypes of Control:1.Text Elements2.Text Box3.Links4.Table5.Radio Group6.Select List7.Drop down8.Check Box9.Buttons10.Hovers11.Tooltips

Page 31: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 31

HTML Basics: Tag Implementation1. <!DOCTYPE html>2. <html>3. <body>

4. <h1><u>My First Heading</u></h1>

5. <p><u>My first paragraph.</u></p>

6. <p><u>My first Link.</u></p>7. <a href="http://www.itprofessionalacademy.in">Visit our

Site</a>

8. <p><u>My first Table</u></p>9. <table style="width:100%">10. <tr>11. <td>Vinod</td>12. <td>Khanna</td>13. <td>50</td>14. </tr>15. <tr>16. <td>Amir</td>17. <td>Khan</td>18. <td>94</td>19. </tr>20.</table>

21.<br>22.<p><u>My first List</u></p>23. <ul>24. <li>Coffee</li>25. <li>Tea</li>26. <li>Milk</li>27.</ul>

28.<br>29.<p><u>My first Input Box</u></p>30. <input type="text" name="firstname">

31.<br>32.<p><u>My first Radio Group</u></p>33. <input type="radio" name="sex" value="male"

checked>Male34. <br>35. <input type="radio" name="sex" value="female">Female

36.<br>37.<p><u>My first Check Box</u></p>

38.<br>39.<input type="checkbox" name="vehicle2" value="Car"> I

have a car 40.<br>41.<p><u>My first Button</u></p>

42.<br>43. <input type="button" onclick="alert('Hello World!')"

value="Click Me!">

44.</body>45.</html>

Page 32: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 32

Object and MethodsEvery thing is an Object.All Objects has properties and methods/functions.

I am an Object:Properties:1. Name: Akash2. Age: 34 3. DNA: ATCG4. Weight: 80KGAnd many more..

Actions I can Do1. Type(what to

type)2. Dance(which

dance)3. Sing(which

song)And many

more…

Page 33: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 33

Object and Methods:HierarchyAll Objects has Parent.

I am an Object:Properties:1. Name: Akash2. Age: 34 3. DNA: ATCG4. Weight: 80KGAnd many more..

Actions I can Do1. Type(what to

type)2. Dance(which

dance)3. Sing(which

song)And many

more…

I am an Object:Properties:1. Name: Akash_Dad2. Age: 603. DNA: ATCG_14. Weight: 75KGAnd many more..

Actions I can Do1. Read(what to

type)

And many more…

Page 34: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 34

Object and Methods<input id="gs_htif0" class="gsfi" disabled="" autocomplete="off" aria-hidden="true" style="border: medium none; padding: 0px; margin: 0px; height: auto; width: 100%; position: absolute; z-index: 1; background-color: transparent; color: silver; transition: all 0.218s ease 0s; opacity: 0; text-align: left; left: 0px;" dir="ltr" kl_virtual_keyboard_secure_input="on">I am an

Object:Properties:1. id: “gs_htifo”2. class: “gsfi”3. background-color: “transparent” and many more…

Actions I can Do1. Type2. Clickand many

more..

GoogleInput Box

Page 35: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 35

Target-Command-Value-Sync

All interactions are the combination of :

1. Target2. Command3. Value4. Sync5. Verify

Analogy: “Paint- This Wall- With Red Color- wait for it to Dry -Verify

Page 36: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 36

QTP Demo Example:Example: •Record ScriptDemo Site: http://parabank.parasoft.com/parabank/index.htm

Script1: ValidateLoginFunctionality

Page 37: QTP Automation Testing Tutorial 1

Copyright 2015 IT Professional Academy 37

QTP DAY 1 Ends.

Thank you.