Wednesday, 29 January 2014

using RegExp object in QTP to reverse a string without using built in methods



The RegExp object belongs to VbScript and it can be used with QTP, while handling characters of string.

The below code reverses a string , without using built in StrRev function:

 
string1="automation"
 
set obj=New RegExp         'create a RegExp object and do following setting
obj.Pattern=".{1}"                'Extract one by one character from the string using pattern property
obj.IgnoreCase=true           'ignore upper or lower case setting using ignorecase property
obj.Global=true                   'The true value to global property searches for all occurrences of '                                           'pattern in string 
Set ch=obj.Execute(string1) 'executes the setting done above, that returns a character array
 
For i= ch.count-1 to 1 step -1   'Now, extract each character from that character array and
revString=revString+(ch(i))       'print it reverse
Next
 
msgbox(revString) 

In the next post, we will discuss further on the RegExp object and its other uses...

QTP Testing Process



  1. Creating Test Plan
  2. Recording a session on the application
  3. Enhancing the test
  4. Debugging the script
  5. Execution (on every patches)
  6. Analyzing the test results
  7. Reporting Defects

3. Enhancing the test involves: 

  • Adding logic and conditional statements
  • Checkpoints
  • Passing inputs from Excel or database
  • Error Handling and Recovery Scenarios


Automation Testing Process


Automation Testing Lifecycle Methodology



  1. Decision to Automated Test: In this phase, A test tool proposal needs to be outlined, which will be helpful in acquiring management support.
  2. Test tool Acquisition: This phase guides the test engineer through the entire test tool evaluation and selection process, starting with confirmation of management support.
  3. Automation Testing Introduction Process: This phase involves Test Process Analysis and Test Tool Consideration.
  4. Test Planning Design & Development: Here, Test Planning involves identifying the hardware, software and network types required to support the test environment. The team considers test data requirements, a preliminary test schedule, performance measure requirements, a procedure to control test configuration and environment, the defect tracking procedure, and associated tracking tool. Test Design determines the number of tests, the ways in which those tests will be approached, and test conditions. Test design standards need to be established and followed. Developing test procedures that are maintainable, reusable, simple and robust can be, in itself, as challenging as the development of the application under test.
  5. Execution and Management of Test: Here, Test metrics provide the test manager with key indicators of the test coverage, progress, and the quality of the test effort.
  6. Test Program Review & Assessment: Test Program review and assessment activities need to be conducted throughout the testing life cycle, in order to allow for continuous improvement

Introduction on Automation


  • Automation is nothing but automating the manual actions through scripting with appropriate objects of the application.
  • QTP is one of such Test Automation Tools. It is developed my Mercury Interactive in 2002. And, acquired by HP (Hewlett-Packard) in 2007. QTP provides Functional test and regression test automation.
  • It can be able to test windows and web applications. Using add-ins, it can be used for special environments also.
  • It provides multilingual support. It supports multi-byte character languages such as Chinese and Japanese also.
  • Because of its wide-range of capabilities, QTP is widely used by many companies to automate their software testing activities.