SlideShare a Scribd company logo
QTP Training Session V

Presented By : Aisha Mazhar
       Aug-16-2012
Agenda - Advance
•   Conditional Statements
•   Error Handling
•   Inserting Transaction Points
•   Schedule execution of scripts.
•   Executing scripts made by others
Conditional Statements
• Enables you to control the flow of your Test or
  component. Two ways:

•   If Then Else – Decision making, evaluates whether a condition is true or
    false, and then based upon the result certain set of statements are run.
    You can check multiple conditions within a single If statement
    using And & Or operators

•   Using Case - Works on a single expression which is evaluated at the
    beginning on the Select Case statement. The result of the expression is
    then compared with the values for each Case in the structure
Error Handling
IF Else

Not IF

Specifying the Response to an Error
Recovery Scenario
• Recovery scenario gives you an option to take some
  action for recovering from a fatal error in the test.

•   Trigger: Trigger is nothing but the cause for initiating the recovery scenario. It
    could be any popup window, any test error, particular state of an object or
    any application error.
•   Action: Defines what needs to be done if scenario has been triggered. It can
    consist of a mouse/keyboard event, close application, call a recovery function
    defined in library file or restart windows. You can have a series of all the
    specified actions.
•   Post-recovery operation: Basically defined what need to be done after the
    recovery action has been taken. It could be to repeat the step, move to next
    step etc.
When to use a Recovery Scenario and when to
         us on error resume next?
• Recovery scenarios are used when you cannot predict at what
  step the error can occur or when you know that error won't
  occur in your QTP script but could occur in the world outside
  QTP, again the example would be "out of paper", as this error
  is caused by printer device driver.

• "On error resume next" should be used when you know if an
  error is expected and don't want to raise it, you may want to
  have different actions depending upon the error that
  occurred. Use err.number & err.description to get more
  details about the error.
Transaction Point
• A utility object called Services for measuring
  transaction time.
• To find out execution time of the by using the
  start transaction and end transaction points
Schedule execution of scripts
1. Create a .vbs file to launch QTP with required settings, add-ins etc.
2. Go To Start > Control Panel > Schedule Tasks > Click Add Schedule Tasks
   Click Next on the screen.
3. Click Browse and select the .vbs file you just created. You will get this
   screen
4. Give a name to the task and select the frequency for performing the given
   tasks. For this demo we will select "One time only“
5. Select Start Time and Start Date. For this demo, select Start Time as
   current time+5 mins and Start date as today's date.
6. Next Screen Enter "UserName", "Password" and "Confirm Password" Click
   Next and you should get this screen.
7. Click on Finish.
Executing scripts made by others
• Your Scripts will be executed by others as
  well. Make sure following points.

  – Write instructions what and how the steps are
    executed.
  – Use comment blocks to define your actions.
  – Make the script easily readable, format it
  – Using of self explanatory variables.
Advantages
• Can execute and share the code on different
  machines.
• No objects storage required.
• Change in object properties does not interupt
  whole application.
• Its fun in learning and writing your test
  yourself 
Thank you 

More Related Content

PDF
Write better, stronger, faster behat steps with ScenarioStateBehatExtension
Rodrigue Villetard
 
PDF
Albert Witteveen - With Cloud Computing Who Needs Performance Testing
TEST Huddle
 
PDF
How to Record Scripts in JMeter? JMeter Script Recording Tutorial | Edureka
Edureka!
 
PPTX
PAC 2019 virtual Stephen Townshend
Neotys
 
PPTX
Qtp training session I
Aisha Mazhar
 
PPTX
Antifragility and testing for distributed systems failure
DiUS
 
PPT
Effective Test Driven Database Development
elliando dias
 
PDF
DRAKON Visual Language: Tutorial. Part 2
Stepan Mitkin
 
Write better, stronger, faster behat steps with ScenarioStateBehatExtension
Rodrigue Villetard
 
Albert Witteveen - With Cloud Computing Who Needs Performance Testing
TEST Huddle
 
How to Record Scripts in JMeter? JMeter Script Recording Tutorial | Edureka
Edureka!
 
PAC 2019 virtual Stephen Townshend
Neotys
 
Qtp training session I
Aisha Mazhar
 
Antifragility and testing for distributed systems failure
DiUS
 
Effective Test Driven Database Development
elliando dias
 
DRAKON Visual Language: Tutorial. Part 2
Stepan Mitkin
 

Similar to Qtp training session V (20)

PPTX
Salient tips for writing effective test cases
BugRaptors
 
PPT
Qtp 9.2 examples
medsherb
 
PPTX
The process of performance testing
Sebastián Lagoueyte
 
PDF
What Is Unit Testing_ A Complete Guide With Examples.pdf
Steve Wortham
 
PPTX
JUnit Test Case With Processminer modules.pptx
pateljeel24
 
PDF
Laravel Load Testing: Strategies and Tools
Muhammad Shehata
 
PPT
Alm qc 11_training
jayant25
 
PDF
What Is Unit Testing A Complete Guide With Examples.pdf
Jace Reed
 
PPTX
Best Practices for Test Case Writing
Sarah Goldberg
 
PDF
Performance tuning Grails applications
GR8Conf
 
PDF
Continuous Integration, Deploy, Test From Beginning To End 2014
Clever Moe
 
PDF
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
Clever Moe
 
PDF
Use Jenkins For Continuous Load Testing And Mobile Test Automation
Clever Moe
 
PDF
Neoload
Kumar Gupta
 
PDF
Software Testing
AdroitLogic
 
PPTX
Lecture (Software Testing).pptx
skknowledge
 
PDF
Performance tuning Grails applications
Lari Hotari
 
PDF
Write unit test from scratch
Wen-Shih Chao
 
POTX
The process of performance testing
Valeria Moreno Zapata
 
PPTX
menulis kasus uji dengan baik dan benar menurut teori
115230101
 
Salient tips for writing effective test cases
BugRaptors
 
Qtp 9.2 examples
medsherb
 
The process of performance testing
Sebastián Lagoueyte
 
What Is Unit Testing_ A Complete Guide With Examples.pdf
Steve Wortham
 
JUnit Test Case With Processminer modules.pptx
pateljeel24
 
Laravel Load Testing: Strategies and Tools
Muhammad Shehata
 
Alm qc 11_training
jayant25
 
What Is Unit Testing A Complete Guide With Examples.pdf
Jace Reed
 
Best Practices for Test Case Writing
Sarah Goldberg
 
Performance tuning Grails applications
GR8Conf
 
Continuous Integration, Deploy, Test From Beginning To End 2014
Clever Moe
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
Clever Moe
 
Use Jenkins For Continuous Load Testing And Mobile Test Automation
Clever Moe
 
Neoload
Kumar Gupta
 
Software Testing
AdroitLogic
 
Lecture (Software Testing).pptx
skknowledge
 
Performance tuning Grails applications
Lari Hotari
 
Write unit test from scratch
Wen-Shih Chao
 
The process of performance testing
Valeria Moreno Zapata
 
menulis kasus uji dengan baik dan benar menurut teori
115230101
 
Ad

Recently uploaded (20)

PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
The Future of Artificial Intelligence (AI)
Mukul
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Ad

Qtp training session V

  • 1. QTP Training Session V Presented By : Aisha Mazhar Aug-16-2012
  • 2. Agenda - Advance • Conditional Statements • Error Handling • Inserting Transaction Points • Schedule execution of scripts. • Executing scripts made by others
  • 3. Conditional Statements • Enables you to control the flow of your Test or component. Two ways: • If Then Else – Decision making, evaluates whether a condition is true or false, and then based upon the result certain set of statements are run. You can check multiple conditions within a single If statement using And & Or operators • Using Case - Works on a single expression which is evaluated at the beginning on the Select Case statement. The result of the expression is then compared with the values for each Case in the structure
  • 4. Error Handling IF Else Not IF Specifying the Response to an Error
  • 5. Recovery Scenario • Recovery scenario gives you an option to take some action for recovering from a fatal error in the test. • Trigger: Trigger is nothing but the cause for initiating the recovery scenario. It could be any popup window, any test error, particular state of an object or any application error. • Action: Defines what needs to be done if scenario has been triggered. It can consist of a mouse/keyboard event, close application, call a recovery function defined in library file or restart windows. You can have a series of all the specified actions. • Post-recovery operation: Basically defined what need to be done after the recovery action has been taken. It could be to repeat the step, move to next step etc.
  • 6. When to use a Recovery Scenario and when to us on error resume next? • Recovery scenarios are used when you cannot predict at what step the error can occur or when you know that error won't occur in your QTP script but could occur in the world outside QTP, again the example would be "out of paper", as this error is caused by printer device driver. • "On error resume next" should be used when you know if an error is expected and don't want to raise it, you may want to have different actions depending upon the error that occurred. Use err.number & err.description to get more details about the error.
  • 7. Transaction Point • A utility object called Services for measuring transaction time. • To find out execution time of the by using the start transaction and end transaction points
  • 8. Schedule execution of scripts 1. Create a .vbs file to launch QTP with required settings, add-ins etc. 2. Go To Start > Control Panel > Schedule Tasks > Click Add Schedule Tasks Click Next on the screen. 3. Click Browse and select the .vbs file you just created. You will get this screen 4. Give a name to the task and select the frequency for performing the given tasks. For this demo we will select "One time only“ 5. Select Start Time and Start Date. For this demo, select Start Time as current time+5 mins and Start date as today's date. 6. Next Screen Enter "UserName", "Password" and "Confirm Password" Click Next and you should get this screen. 7. Click on Finish.
  • 9. Executing scripts made by others • Your Scripts will be executed by others as well. Make sure following points. – Write instructions what and how the steps are executed. – Use comment blocks to define your actions. – Make the script easily readable, format it – Using of self explanatory variables.
  • 10. Advantages • Can execute and share the code on different machines. • No objects storage required. • Change in object properties does not interupt whole application. • Its fun in learning and writing your test yourself 