Translate

Showing posts with label Quick Test Pro. Show all posts
Showing posts with label Quick Test Pro. Show all posts

GetRowCount Method in QTP

This method returns the total number of rows containing data in the data table.

Msgbox Datatable.GetSheet("SheetName").GetRowCount

Subscribe to Quality Assurance Knowledge Base! by Email

Exist method in QTP

This method will wait for a specified duration to check weather the object exists in Application under test. Accordingly return a boolean value.

Syntax:

TestObject.Exist(intTimeOut)

Return Type: Boolean

This will wait & check for the existence of TestObject for specified seconds. It returns true if it finds the object during that time or false otherwise.

This method does not check the child objects existence.

To explain it better, please see below a sample code

If Browser("Browser").Page("Page").WebEdit("Test").Exist(10) Then
          <<your code here>>
Else
         <<Your code here>>
End If



Subscribe to Quality Assurance Knowledge Base! by Email

Test Automation - Overview

As we all know, testing can be done in 2 different ways.

Manual Testing
Automated Testing

A test case that can be executed manually can also be automated. But, before we plan to invest time & money in automation, we need to consider if the time spent in automating a test case will actually save us time & money (This is called ROI - "Return on Investment" in business lingo).

Manual testing has some drawbacks
  1. Time consuming.
  2. Number of resources required to execute test cases is more when compared to automated testing
  3. There is always a chance of human error (oversight)
To overcome these facts, automated testing can be used. Some of the advantages of automated testing are:
  1. Fast
  2. Reliable
  3. Reusable
  4. Repeatable
  5. Programmable
  6. Comprehensive
Before a decision is taken, whether or not to go for automation. Some factors need to be considered.

Automation is costly. 
  • Cost will be incurred to procure the licence of automation tool
  • Train the resources
Automation should not be done for applications:
  1. Not stable
  2. Where the requirements are changing  frequently
  3. Which are developed using agile methodology

Can we declare a array in one action and pass it to another action in QTP

Let's assume you have an array Arr[] in Action A1.

You can do the following in A1
Environment.value(env) = Arr

This statement will map the array arr environment variable env.

To use this array in another action A2.
write the following in Action A2
var= environment(env)

We can then access the array elements with var which is mapped with the array Arr

Subscribe to Quality Assurance Knowledge Base! by Email