Thursday, March 31, 2011

QTP-Descriptive Programming

Introduction to Descriptive Programming:


Descriptive programming is used when we want to perform an operation on an object that is not present in the object repository.
 
How to write Descriptive Programming?

There are two ways in which descriptive programming can be used
1. By giving the description in form of the string arguments.
2. By creating properties collection object for the description.

1. By giving the description in form of the string arguments.


This is a more commonly used method for Descriptive Programming.

You can describe an object directly in a statement by specifying property:=value pairs describing the object instead of specifying an object’s name. The general syntax is:

TestObject("PropertyName1:=PropertyValue1", "..." , "PropertyNameX:=PropertyValueX")
TestObject—the test object class could be WebEdit, WebRadioGroup etc….
PropertyName:=PropertyValue—the test object property and its value. Each property:=value pair should be separated by commas and quotation marks. Note that you can enter a variable name as the property value if you want to find an object based on property values you retrieve during a run session.

2. By creating properties collection object for the description.


Properties collection also does the same thing as string arguments. The only difference is that it "collects" all the properties of a particular object in an instance of that object. Now that object can be referenced easily by using the instance, instead of writing "string arguments" again and again. It is my observation that people find "string arguments" [1] method much easier and intuitive to work with.

To use this method you need first to create an empty description
Dim obj_Desc ‘Not necessary to declare
Set obj_Desc = Description.Create

Now we have a blank description in “obj_Desc”. Each description has 3 properties “Name”, “Value” and “Regular Expression”.
obj_Desc(“html tag”).value= “INPUT”

When you use a property name for the first time the property is added to the collection and when you use it again the property is modified. By default each property that is defined is a regular expression. Suppose if we have the following description
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt.*”

This would mean an object with html tag as INPUT and name starting with txt. Now actually that “.*” was considered as regular expression. So, if you want the property “name” not to be recognized as a regular expression then you need to set the “regularexpression” property as FALSE

obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt.*”
obj_Desc(“name”).regularexpression= “txt.*”

This is how we create a description. Now below is the way we can use it
Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”

When we say .WebEdit(obj_Desc) we define one more property for our description that was not earlier defined that is it’s a text box (because QTPs WebEdit boxes map to text boxes in a web page).

When and Where to use Descriptive programming?


Below are some of the situations when Descriptive Programming can be considered useful:

1. One place where DP can be of significant importance is when you are creating functions in an external file. You can use these function in various actions directly , eliminating the need of adding object(s) in object repository for each action[If you are using per action object repository]

2. The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. “Logout <>”.

3. When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object. [For QTP8.2 and below Mercury recommends that OR size should not be greater than 1.5MB]

4. When you don’t want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository


Scenario 1: Suppose we have a web application that has not been developed yet.Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing

Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page

5. Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well.

6. When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach.

References:

1) QuickTestProfessional Documentation

2) Tarun Lalwani's DP Document










Wednesday, March 30, 2011

QTP: Find No. of Links on Page

To find the number of links on Page Using QTP:

Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
Set Links = Browser("Browser").Page("Page").ChildObjects(oDesc)
NumberOfLinks = Links.Count()
Msgbox NumberOfLinks

Saturday, March 26, 2011

Fake Name and Data Generator Tool

Hey,

Find from below link, you can generate Fake name and address details for the Test Data.
http://www.fakenamegenerator.com/

Thanks.

Thursday, March 24, 2011

Firebug-Mozilla Add on for Developer n Tester

Hi All,

I found Firebug Add on as very useful in Testing. Using Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

Also you can get the session details, URL information etc from it. By changing some value in labels and dropdown, you can find some issues in web page.

You can download it from https://addons.mozilla.org/en-US/firefox/addon/firebug/

Hope this will help you.


YSlow -Mozilla Add On for Performance Testing

Hey Folks,

When I was doing Web Application Testing, I come across very good Add On of Mozilla- YSLOW.

YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages. YSlow is a Firefox add-on integrated with the Firebug web development tool. YSlow grades web page based on one of three predefined ruleset or a user-defined ruleset. It offers suggestions for improving the page's performance, summarizes the page's components, displays statistics about the page, and provides tools for performance analysis, including Smush.it™ and JSLint.

You can download it from https://addons.mozilla.org/en-us/firefox/addon/yslow/

Hope it will help you.


FireShot - Web page capturing Mozilla Add on

Hi Guys,

Mozilla Provides one very good Add On for capturing Entier Web Page or part of the webpage. Unlike other extensions, this plugin provides a set of editing and annotation tools, which let users quickly modify web captures and insert text annotations and graphical annotations. Such functionality will be especially useful for web designers, testers and content reviewers. From https://addons.mozilla.org/en-us/firefox/addon/fireshot/ link, you can download it.

Hope, this will help you.

Sunday, March 20, 2011

Prioritization of tests


Prioritization of tests
Hey folks,
Always Testers get less time to test the application, in this type of situation, one must take a decision to prioritization of his test. Here are some points we can take in consideration for prioritize it. If you found some more please add in comments, so all can get good information. I try my best to give you good information, hope you guys like it.

Principle
Prioritize tests So that, whenever you stop testing, you have done the best testing In the time available.

  • How to Prioritize
  • Possible ranking criteria
  • Test where a failure would be:
  • most severe
  • more visible
  • More likely
  • Ask the customer to prioritize the requirements
  • Critical to customer’s business
  • Areas changed most often
  • Areas with most problems in the past
  • Most complex areas, or technically critical 

Quality Assurance & Quality Control


Quality Assurance
All the planned and systematic set of activities (facilitation, training, measurement and analysis) implemented within the quality system to provide:
  • Confidence that the project will satisfy the relevant quality standards
  • Meet user needs
  • Conform to specified requirements
Quality Control
The process by which product quality is compared with applicable standards, and the action taken when nonconformance is detected.
  • Its focus is defect detection and removal.
  • The performance of these tasks is the responsibility of the people working within the process.

Quality Control Vs Quality Assurance
Quality Control is directed toward detecting and correcting defects. 
Quality Assurance is directed toward preventing defects from occurring
QA is QC over OC
 
Quality Control
Quality Assurance
Definition
QC is checking at the end of some development process (e.g.- a design activity ) that we have built quality in
QA is having an overall development and management process that provides right environment for ensuring quality of final product.
Description
QC is like testing a module against RS or design document , measuring response time and throughput
QA is checking that a process is properly planned and executed and thus maintaining high quality.
What it does
It is oriented towards ‘detection and correction’.
It is oriented towards 'prevention’
Stages
  1. Define features and levels
  2. Define feature check procedure
  3. Carrying out the check procedure
  4. Record the result take and record any corrective action taken.
  1. Determination of quality policy through Quality Management System
  2. Checking that predetermined QC activities are being properly taken care of.
Best carried out  on
Products
Processes
Phase of Implementation
QC depends on SDLC model. E.g. QC is done in Testing phase of waterfall model
QA does not dependent on SDLC model
Technique
Structured walkthrough and Functional Testing
Quality policy defined and generally implemented in the form of Quality Management System is used to carry out QA.

 

 

 

Quality & Quality Attributes



What Is Software Quality?

Quality in fact
o   Doing the right thing, in right way, the first time
o   Doing it on time within budget
 Quality perception
1.       Producers view of quality
o   Meets specifications and delivering the right product
o   Non-variance from specification
o    Is maintainable
2.       Consumers view of quality
o   Fit for use and satisfying our customer needs
o   Non-variance from what is desired
o   Quality Attributes
Quality Attributes
 Correctness
The extent to which a program satisfies its specifications and fulfils the user’s mission and goals
Reliability
The extent to which a program can be expected to perform its intended function with the required precision

Efficiency
The amount of computing resources and code required by a program to perform a function
Integrity
The extent to which access to software or data by unauthorized persons can be controlled

Usability
The effort required for learning, operating, preparing input, and interpreting output of a program

Maintainability
The effort required for locating and fixed an error in an operational program

Testability
The effort required for testing a program to ensure it performs its intended function

Flexibility
The effort required for modifying an operational program

Portability
The effort required for transferring a program from one hardware configuration and/ or software system environment to another

Reusability
The extent to which a program can be used in other applications

Interoperability
The effort required to couple one system with another


About TFS - Team Foundation Server

What is TFS?
TFS or Team Foundation Server, a Microsoft product, provides version/source control, build management, project reporting, team/project web portals, project and task/defect tracking in a unified server.   Its focus is to improve collaboration in software development projects. 
There is some of the new terminology with TFS.

Team Project is a group of artifacts, including source code, reports, and documents, used by a team and its members to perform and track a related set of work.   A team project is like a project vob in IBM Rational ClearCase.   Artifacts can only belong to one and only one team project.  

Work Items define work activities needed to fix a bug, complete a project or support a customer scenario. In TFS, work activities are further defined. projects have six different work item types (Product Backlog Item, Bug, Sprint Backlog Item, Sprint, Impediment and Sprint Retrospective).   

Areas are used to divide team projects into smaller logical or functional parts.    
  
Iterations are used to define development phases or sprint/scrums during the team project’s lifecycles.      

Active Directory Concept


An active directory is a service that is provided by Microsoft that stores information about items on a network so the information can be easily made available to specific users through a logon process and network administrators. By using an Active Directory it is possible to view an entire series of network objects from a single point and obtain an overall hierarchal view of the network.
Active Directory uses a number of standardized protocols to provide a variety of network services, including:
  • Lightweight Directory Access Protocol LDAP, the industry standard directory access protocol, compatible with many management and query applications. Active Directory supports LDAPv3 and LDAPv2.
  • Optional Kerberos-based authentication
  • DNS-based naming and other network information
Features include: 
  • Central location for network administration and security[1]
  • Information security and single sign-on for user access to networked resources[1]
  • The ability to scale up or down easily[1]
  • Standardizing access to application data[1]
  • Synchronization of directory updates across servers[1]
Active Directory stores all information and settings for a deployment in a central database. Active Directory allows administrators to assign policies, deploy and update software. Active Directory networks can vary from a small installation with a few computers, users and printers to tens of thousands of users, many different network domains and large server farms spanning many geographical locations 

How an Active Directory is Used

Active Directories are used by network administrators to simplify network maintenance processes within a large organization. Instead of having to perform updates manually, a network administrator can update one object in a single process.
Active Directories are also used by network administrators to allow or deny access to specific application by the end user through the trees in the network. Additionally, they are used to keep a large network organized and maintained without having to perform each task through an individual process.
Because an Active Directory supports distributed network environments they can be extremely complex and require a network administrator who is well-versed in this type of technology. However, without an Active Directory it would be very difficult for a large organization to effectively store information and data on a large network.

Thursday, March 10, 2011

Example of IPV6


Example of IPv6 address:
4FDE:0000:0000:0002:0022:F376:FF3B:AB3F

Whenever you want to give static IPv6 address then change the block# 5 of IPv6 with the last block of IPv4.

If you IPv4 address is : 40.40.40.155 then IPv6 address would be 4FDE:0000:0000:0002:0155:F376:FF3B:AB3F

Thursday, March 3, 2011

Test Summary Report


Test Summary Report
test summary report is a testing work product that formally summarizes the results of all testing on an endeavor.

Why Required?
  • Summarize all of the testing that was performed since the previous test summary report.
  • Enable project management and the customer to know the status of project testing.


Benefits
Project Management and end customer can:
  • Able to get project testing status
  • Able to get application quality status
  • Able to take corrective actions, if required


Guidelines
1.       A Test summary report should generated on regular basis
2.       It should be in metrics, charts and table forms, if possible
3.       Copy of each summary report should maintain until the build release. It can be kept on central location, for future reference
4.       To write  a test summary report, required pre requisites are- test plan should be complete, test execution should occur and respective test reports should be available.

Content of Test Summary Report 
Introduction
  •  Definition
  •  Objective
  • Reference document
  • Target Audience
  • Test Summary
    • Unit Testing Summary
    • Integration Testing Summary
    • System Testing Summary
    • Launch Testing Summary
  • List of Severity One Failures
  • Testing Issues Requiring Resolution
  •  Appendices:
    • TBDs
    • Assumptions

For each kind of testing summarized, a test summary report will include the following information (previous report, current report, and percentage change):
  • Test Suite Information:
    • o   Number of test suites planned.
    • o   Number and percentage of test suites implemented.
    • o   Number and percentage of test suites executed.
  •  Test Case Information:
  •  Number of test cases planned.
  •  Number and percentage of test cases implemented.
  •  Number and percentage of test cases executed.
  •  Number and percentage of test cases passed.
  •  Number and percentage of test cases failed (total and by severity).

About Test Data


Hey folks,

It’s so long time, to write blog on testing field back. Here I try to cover all about test data.

Test Data
A set of data created for testing new or revised applications.
Test data should be developed by the user as well as the programmer, tester and must contain a sample of every category of valid data as well as many invalid conditions as possible
Tester should check and update the test data before execution of any test case

Why Required
If you are writing a Test case then you need input data for executing that test case. If you don’t have the systematic approach for building test data while writing and executing test cases then there are chances of missing some important test cases. Preparing proper test data is a core part of “project test environment setup”. Preparation of test data is part of preparing a Test bed activity. Tester cannot pass the bug responsibility saying that complete data was not available for testing. Tester should create his/her own test data additional to the existing standard production data. Your test data set should be ideal in terms of cost and time.

Format of Test Data
The test data may be any kind of input to application, any kind of file that is loaded by the application or entries read from the database tables. It may be in any format like xml test data, system test data, SQL test data or stress test data.

Tips For Test Data
1.       Good practice for every tester keep/make their own set of test data. Sometimes on same build many testers work, so they have same access on the test data files and change the data as per their requirement. So better, keep a personal copy of your own data. It may be of any format like inputs to be provided to the application, input files such as word file, excel file or other photo files
2.       Always keep your test data up to date. Sometimes, test data is not updated so long times.
3.       Before filing the bug, please make sure that your existing test data is not corrupted for executing the test case on application.
4.       Try to make test data as per real time use of application
5.       Test data can be said to be ideal if for the minimum size of data set all the application errors get identified.
6.       Try to prepare test data that will incorporate all application functionality, but not exceeding cost and time constraint for preparing test data and running tests.

How to prepare test data that will ensure complete test coverage?
Design your test data considering following categories:
1.       No data: Run your test cases on blank or default data. See if proper error messages are generated.
2.       Valid data set: Create it to check if application is functioning as per requirements and valid input data is properly saved in database or files.
3.  Invalid data set: Prepare invalid data set to check application behavior for negative values, alphanumeric string inputs.
    • Illegal data format: Make one data set of illegal data format. System should not accept data in invalid or illegal format. Also check proper error messages are generated.
    • Boundary Condition data set: Data set containing out of range data. Identify application boundary cases and prepare data set that will cover lower as well as upper boundary conditions.
    • Data set for performance, load and stress testing: This data set should be large in volume.
    • This way creating separate data sets for each test condition will ensure complete test coverage.
In this article, I took the help from one stop testing site, As I can gather all the information at one place at time, I use some of the part from there