Translate

Showing posts with label automation. Show all posts
Showing posts with label automation. Show all posts

Selenium automation tool

Selenium is an automation tool that automates web browsers & can be used to automate regular mundane tasks or for testing. In the context of this blog, we will stick to it's use for automated testing.
So, here is another definition of Selenium.

Selenium is a software testing framework for web applications that allows you to write UI tests cases against any website. It runs in many browsers & operating systems & can be controlled by many programming languages & testing frameworks.

Selenium has 2 modules that you can select based on your requirement.


  1. Selenium web driver
  2. Selenium IDE

Use Selenium web driver if you want to create robust, browser based regression automation suites & test & you want to scale & distribute scripts across many environments
Use Selenium IDE if you want to create quick bug reproduction scripts. This is a simple add-on that will do simple record-playback of interactions with browser.


Subscribe to Quality Assurance Knowledge Base! by Email

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

Load Runner Overview

Load Runner is an HP product originally owned by Mercury. Currently, it has a 70% market share in the world of performance testing.

Load runner is a 3 stage architecture.

  • Vugen - records & enhances scripts
  • Controller - generates user load as defined in ru-time settings
  • Analyzer - used to analyze the results of the performance test.
These 3 components are available independently or as a package.

Load runner supports almost all protocols

Subscribe to Quality Assurance Knowledge Base! by Email

Load Runner Tutorial

Recently, I've decided to share my knowledge on Load Runner.

Below are the topics, I'm planning to cover in my next few posts.

  1. Load Runner Overview
  2. Vuser
    1. Scripting in Vuser
  3. Views (Tree & Script view)
  4. Transactions
  5. Playback
  6. Correlation
    1. Manual Correlation
    2. Automatic Correlation
  7. Parameterization
  8. Check points
  9. Controller
  10. Analyzer

Record/Playback Approach

Record & playback is a great feature in almost all automation tools. It works flawlessly on any static webpage (although record/playback can be used on many other interfaces, but for simplicity we will limit our discussion to a webpage).
But, what if its not a static page? What if, you want to test application with different data types?...the list is endless..

Some of the points that I would like to note are:


  1. Look for dynamic locators in HTML. Sometimes, these appear n cookies & you can comment them.
  2. Flow-control cannot be implemented manually
  3. Parameterization to execute using different data points has to be taken care separately

Basic Database Concepts

Normalization

It is a process of organizing tables in a relational database to remove redundancy. It is mostly done by breaking down larger tables into logical smaller inter-related tables.

There are 7 different normal forms

First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF )
Fourth Normal Form (4NF)
Fifth Normal Form (5NF)

Exception Handling in QTP

Most of the times we do encounter a situation when an exception occurs, which is not actually a part of requirements. But, it is an unexpected behavior of the application. This is the reason it is called as exception & not error.
Some common examples are system went down, divide by 0 error etc.

These exceptions should be handled in the code, because if something unexpected happens then the script will not know what to do & it will fail.

Exception handling refers to anticipation & resolution of exceptions.

Some of the ways to handle exceptions is by using if..then..else statements, Switch Case statements.

Error Handling in QTP:

  • Synchronization: 
    • In QTP a synchronization point can inserted to instruct the script to pause the test until the condition specified in synchronization statement becomes true. 
    • An example where synchronization is required when you need to verify a value is present on a page & then based on that value take the next course of action. In this case if you don't wait for the page to load the script may not find the value & take a different course route altogether fetching incorrect results.
    • Synchronization can be achieved by using exist or waitproperty or both.
    • returnvalue = Object.Exist([Timeout])
    • returnvalue = Object.WaitProperty(PropertyName, PropertyValue, [Timeout])
  • Recovery Scenario:
    • A recovery scenario has 3 components:
      • Trigger: An exception that may occur & trigger the recovery scenario
      • Recovery: Instructions on how to handle recovery
      • Post Recovery: What next, after recovery is performed.
  • On Error statements:
    • On error statement can be used when you know that an error can occur at a point, but you don't want to notify.

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