Tuesday, February 26, 2013

Navigating to one t-code from another using QTP

Navigating to one t-code from another using QTP By Ankesh Pandey  

Many of us may be aware of this topic which i am posting. But for me it took almos 5 months to discover this trick.:(

Let me explain what i use to do before discovering this cool trick.
Suppose you are on a t-code page , say VA01. After completing your operation, you need to navigate back to home page. I use to click on back button for this, which inturn was increasing OR size. This was not reliable too.
'Navigate back
SAPGuiSession("Session").SAPGuiWindow("").SAPGuiButton("Back").click

'Or to jump to another T-code from here, i was using /n in the t-code box

SAPGuiSession("Session").SAPGuiWindow("").SAPGuiOKCode("OK").Set "/nVA03"

For the above code to run, all the objects must be present in OR. Miss of any will result in error.

To resolve this we can use the 'Reset' option available in QTP.


SAPGuiSession("Session").Reset  // This code will take you to home page, doesnt matter where you are.
SAPGuiSession("Session").Reset "VA03"  //This code will take you to VA03 t-page from anywhere.

This will save lot of time and will optimize memory as well.

Wasn't it cool? Go ahead, use this option in your code.

10 Steps to become QTP Guru

10 steps to become QTP guru from (http://motevich.blogspot.in)

Would you like to know how to become QTP guru?
The recipe is simple. You should learn the following:
  1. VBScript
    QTP uses VBScript language. That's why strong knowledge of VBScript is 'must have'.
    Sources:
  2. Software Testing Automation Frameworks
    To write good automated tests, you should know how to write them.
    There are different approaches and solution. There is not a silver bullet.
    Sources:
  3. HP QuickTest Professional Tutorial
    This QTP tutorial cames with QTP.
    It's quite clean and informative. Its main goal is to show and explain basic concepts of QuickTest Professional. It provides knowledge on:
    • creating a test
    • working with Object Repository (OR)
    • running and analyzing tests
    • verifying tests
    • parameterizing, etc
    Sources: '\help\QTTutorial.pdf' or '\help\Tutorial.chm' in QTP Install folder.
  4. HP QuickTest Professional User's Guide
    As previous tutorial, the present User's Guide come with QTP install too.
    This guide is intended for QuickTest Professional users at all levels. It gives a deeper knowledge on:
    • working with QTP Object Repositoies
    • designing tests
    • enhancing tests (checkpoints, parameterizing, etc)
    • maintaining anf debugging tests
    • advanced testing features, etc
    Sources: '\help\QTUsersGuide.pdf' or '\help\MainUsersGuide.chm' in QTP Install folder.
  5. COM/DCOM Technologies
    When working with QTP, you will be closely linked with such Microsoft's applications, as: Excel, Word, Outlook. So, I recommend to get familiar with COM, COM Technologies, and COM objects of:
  6. SQL
    SQL is so important in programming, that I strongly recommend to spend time to learn SQL:
    • concepts of RDBM
    • selecting/updating/deleting data
    • SQL queries optimizations
    • databases administration
    Sources:
  7. XML
    XML is an extremely popular and useful format. I'm sure that нou will have to deal with data, stored in XML-files.
    Sources:
  8. HTML, DOM
    Since QuickTest Professional works perfectly with web applications, you should be expert in related fields - HTML, HTTP, DHTML, DOM, etc. They will simplify your future QTP script and make them more reliable and maintenable.
    Sources:
  9. HP QTP Knowledge Base
    It contains a lot of practical articles about QuickTest Professional.
    You can find there QTP webinars, QTP FAQs, documentations, solutions of your problems or different ways how to improve your QTP automated tests.
    Sources:
  10. Useful sites
    Sure, it's impossible to know all information on QTP.
    That's why I recommend to use these two sites to search answers to your QTP questions: