Thursday, April 28, 2011

QTP-Working with Radio Group


Working with Radio Group
To check whether radio group exist or not
Browser("title:=browser").Page("title:=page).WebRadioGroup("name:=newEnrollEmployeeType").Exist(10)
To select radio button
Browser("title:=browser").Page("title:=page).WebRadioGroup("name:=newEnrollEmployeeType").Select "#1"
or
Browser("title:=browser").Page("title:=page).WebRadioGroup("name:=newEnrollEmployeeType").Select "N"
Allitem values should give in Select Value
To get how many radio buttons in group
itemcnt=Browser("title:=browser").Page("title:=page).WebRadioGroup("name:=newEnrollEmployeeType").GetROProperty("items count")
msgbox itemcnt

QTP- Working with WebList



Working with WebList
To check whether weblist is exist on page or not.
Var=Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).Exist(10)
Msgbox var
If var returns true then weblist exist on page.
Click on Weblist
Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).Click
Get particular item from weblist
Var=Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).GetItem(2)
Msgbox var
Var return second element from the weblist
To get count of Weblist item
Var= Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).GetROProperty(“items count)
Msgbox var
To select particular item from list
Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).Select(2)
It will select second item from the list
To count how many weblist exist on the page
Set oDesc = Description.Create()
 oDesc("micclass").Value = "WebList"
Set Lists = Browser(“title:=browser”).Page(“title:=page”).ChildObjects(oDesc)
 NumberOfLists = Lists.Count()
Msgbox NumberOfLists
To get last element from weblist
Itemcnt= Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).GetROProperty(“items count)
Itemvalue= Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).GetItem(Itemcnt)
Browser(“title:=browser”).Page(“title:=page”).WebList(“html id:=name”).Select Itemvalue

Wednesday, April 27, 2011

Web Services Concept

Web Service:
Web services (sometimes called application services) are services (usually including some combination of programming and data, but possibly including human resources as well) that are made available from a business's Web server for Web users or other Web-connected programs. Providers of Web services are generally known as application service providers.
The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the services available and UDDI is used for listing what services are available. Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other's IT systems behind the firewall.
In Simple Term,
  •         Web services are application components
  •         Web services communicate using open protocols
  •         Web services are self-contained and self-describing
  •         Web services can be discovered using UDDI
  •         Web services can be used by other applications
·         XML is the basis for Web services
Advantage of Web Service
  • Web Services are platform-independent and language-independent, since they use standard XML languages. This means that my client program can be programmed in C++ and running under Windows, while the Web Service is programmed in Java and running under Linux.
  • Most Web Services use HTTP for transmitting messages (such as the service request and response). This is a major advantage if you want to build an Internet-scale application, since most of the Internet's proxies and firewalls won't mess with HTTP traffic (unlike CORBA, which usually has trouble with firewalls).
Disadvantages of Web Service:
  • Overhead. Transmitting all your data in XML is obviously not as efficient as using a proprietary binary code. What you win in portability, you lose in efficiency. Even so, this overhead is usually acceptable for most applications, but you will probably never find a critical real-time application that uses Web Services.
  • Lack of versatility. Currently, Web Services are not very versatile, since they only allow for some very basic forms of service invocation. CORBA, for example, offers programmers a lot of supporting services (such as persistency, notifications, lifecycle management, transactions, etc.). Fortunately, there are a lot of emerging Web services specifications (including WSRF) that are helping to make Web services more and more versatile.

How Does it Work?

The basic Web services platform is XML + HTTP.
XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.
The HTTP protocol is the most used Internet protocol.
Web services platform elements:
  • SOAP (Simple Object Access Protocol)
  • UDDI (Universal Description, Discovery and Integration)
  • WSDL (Web Services Description Language)
What is SOAP?
SOAP is an XML-based protocol to let applications exchange information over HTTP.
Or more simple:
  •         SOAP is a protocol for accessing a Web Service.
  •         SOAP stands for Simple Object Access Protocol
  •         SOAP is a communication protocol
  •         SOAP is a format for sending messages
  •         SOAP is designed to communicate via Internet
  •         SOAP is platform independent
  •         SOAP is language independent
  •         SOAP is based on XML
  •         SOAP is simple and extensible
  •         SOAP allows you to get around firewalls
  •    SOAP is a W3C standard
What is WSDL?
·         WSDL is an XML-based language for locating and describing Web services.
  •          WSDL stands for Web Services Description Language
  •          WSDL is based on XML
  •          WSDL is used to describe Web services
  •          WSDL is used to locate Web services
  •          WSDL is a W3C standard
What is UDDI?
UDDI is a directory service where companies can register and search for Web services.
  • UDDI stands for Universal Description, Discovery and Integration
  • UDDI is a directory for storing information about web services
  • UDDI is a directory of web service interfaces described by WSDL
  • UDDI communicates via SOAP
  • UDDI is built into the Microsoft .NET platform
Type of uses of Web Service
1.      Reusable application-components.
There are things applications need very often. So why make these over and over again?
Web services can offer application-components like: currency conversion, weather reports, or even language translation as services.
2.      Connect existing software.
Web services can help to solve the interoperability problem by giving different applications a way to link their data.
With Web services you can exchange data between different applications and different platforms.
Why Web Services
  •        A few years ago Web services were not fast enough to be interesting
  •                  Interoperability has Highest Priority
When all major platforms could access the Web using Web browsers, different platforms could interact. For these platforms to work together, Web-applications were developed.
Web-applications are simple applications that run on the web. These are built around the Web browser standards and can be used by any browser on any platform.
  •      Web Services take Web-applications to the Next Level
By using Web services, your application can publish its function or message to the rest of the world. Web services use XML to code and to decode data, and SOAP to transport it (using open protocols). With Web services, your accounting department's Win 2k server's billing system can connect with your IT supplier's UNIX server.

This article is contributed by “Sudhir Patil”. Thank you.

Wednesday, April 13, 2011

Working with FileSystemObject- Part 1

How to get List of subfolder and count of Subfolder

Set fso = CreateObject("Scripting.FileSystemObject")

Set b = fso.GetFolder("C:\TestEnvironments")
Set c = b.SubFolders
foldercount=c.Count
msgbox foldercount
For Each d in c
e=e&d.name&vbnewline
Next
msgbox e

Working with some file system methods

Set f1 = CreateObject("Scripting.FileSystemObject")

Set f2 = f1.GetFile("c:\path.txt")
Filecreatedon = "File was Created on: "&f2.DateCreated
Msgbox Filecreatedon
fileDateLastModified="file path is:" &f2.DateLastModified
Msgbox fileDateLastModified
filetype="File type is:" &f2.Type
Msgbox filetype
filepath="file path is:" &f2.Path
msgbox filepath
filesize="file path is:" &f2.Size
msgbox filesize
'To find the type of file extension from given folder
Set ParentFld = fso.GetFolder ("E:\Trupti")

For Each oFile In ParentFld.files
' msgbox fso.GetExtensionName(oFile.Path )
'to find the extensionname of file
If fso.GetExtensionName(oFile.Path ) = "docx" Or fso.GetExtensionName(oFile.Path ) = "doc" then
txtCount = txtCount + 1
END IF
Next
msgbox "file type is:" &txtCount

QTP-How to get number of controls (Links, Edits, Images, etc) with DP

Hi,

If you want to find the number of links, webedits, images etc controls on the page, then use following.

Function GetAllSpecificControls(Page, MicClass)

Set Desc = Description.Create()
Desc("micclass").Value = MicClass
Set GetAllSpecificControls = Page.ChildObjects(Desc)
End Function

Function GetAllEdits(Page)
Set GetAllEdits = GetAllSpecificControls(Page, "WebEdit")
End Function

Function GetAllButtons(Page)
Set GetAllButtons = GetAllSpecificControls(Page, "WebButton")
End Function

Function GetAllLinks(Page)
Set GetAllLinks = GetAllSpecificControls(Page, "Link")
End Function

Function GetAllImages(Page)
Set GetAllImages = GetAllSpecificControls(Page, "Image")
End Function

Set oPage = Browser("Google Sets").Page("Google Sets")

MsgBox "Number of Edits: " & GetAllEdits(oPage).Count
MsgBox "Number of Buttons: " & GetAllButtons(oPage).Count
MsgBox "Number of Links: " & GetAllLinks(oPage).Count
MsgBox "Number of Images: " & GetAllImages(oPage).Count

Monday, April 11, 2011

About Normalization

What is Normalization?
Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: eliminating redundant data (for example, storing the same data in more than one table) and ensuring data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.

First Normal Form (1NF)
First normal form (1NF) sets the very basic rules for an organized database:
  • Eliminate duplicative columns from the same table.
  • Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).  
Second Normal Form (2NF)
Second normal form (2NF) further addresses the concept of removing duplicative data:
  • Meet all the requirements of the first normal form.
  • Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
  • Create relationships between these new tables and their predecessors through the use of foreign keys.  
Third Normal Form (3NF)
The rules of 3NF are mentioned here
  • Make a separate table for each set of related attributes, and give each table a primary key.
  • If an attribute depends on only part of a multi-valued key, remove it to a separate table
  • If attributes do not contribute to a description of the key, remove them to a separate table. 
Fourth Normal Form (4NF)
Finally, fourth normal form (4NF) has one additional requirement:
  • Meet all the requirements of the third normal form.
  • A relation is in 4NF if it has no multi-valued dependencies.  
Remember, these normalization guidelines are cumulative. For a database to be in 2NF, it must first fulfill all the criteria of a 1NF database.

Sunday, April 10, 2011

More About Scrum

Scrum
Scrum excels on urgent projects that are critical to the organization. Scrum excels when requirements are unknown or changing. Scrum helps by helping teams excel

Scrum has been used for…
  • FDA-approved, life-critical software for x-rays and MRIs
  • Enterprise workflow systems
  • Financial payment applications
  • Biotech
  • Call center systems
  • Tunable laser subsystems for fiber optic networks
  • Application development environments
  • 24x7 with 99.99999% uptime requirements
  • Multi-terabyte database applications
  • Media-neutral magazine products

Scrum Characteristics
  •          One of the agile methodologies
  •          Self-organizing teams
  •          Product progresses in a series of month-long “sprints”
  •          Requirements are captured as items in a list of “product backlog”
  •          No specific engineering practices prescribed
  •          Wraps existing engineering practices, including Extreme Programming
  •          Delivers business functionality in 30 days

Scrum’s Roles
  •          The Product Owner
  •          The Scrum Master
  •          The Team
  •          Everyone else is not part of Scrum
The Product Owner
  •          Creates initial product vision - overall requirements
  •          Manage and prioritize the Product Backlog
  •          Decide on release dates and its contents
  •          Responsible for the ROI, audience, etc.
  •          Interact with stakeholders and customers to define the Product backlog
  •          Adjust features and prioritize every sprint, as needed!
  •          Accept or reject work results during the Sprint Review
The Scrum Master
  •          Protect values and principles
  •          Removes impediments
  •          Keep the team fully functional and productive
  •          Enable cooperation
  •          Shield the team from “dark forces”
  •          Facilitates integration
  •          Does NOT allocate tasks
The Team
  •          Typically 7 plus or minus 2
  •          Self organizing
  •          Self managing
  •          Full time allocated
  •          Cross functional (Developers , QA ,Doc ,UED, PM etc…)
  •          Figure out how to turn Scrum backlog into an increment of functionality.
  •          Responsible for the quality
  •          Estimates the complexity
  •          Committed to developing functionality
Chickens
  •          No formal responsibilities
  •          No accountabilities
  •          Not a team member
  •          Someone who is interested in the project
Facilities Strategy
  •           Open space.
  •           Tables in the middle of the space.
  •          Cubbies (Private) around the outside of the space
Scrum Practices
  •          The Sprint Planning Meeting
  •          The Sprint
  •          The Daily Scrum
  •          The Sprint Review Meeting
  •          The Sprint Retrospective
  •          All other practices are not part of Scrum
Scrum’s Artifacts
  •          The Product Backlog
  •          The Product Burndown Chart
  •          The Sprint Goal
  •          The Sprint Backlog
  •          The Sprint Burndown Chart
  •          The Potentially Shippable Product Increment

About Agile Scrum Process

What is agile scrum (sprint) process?
Scrum is a software development process. In today’s rapid world stakeholders want immediate return on their investments. They don’t want to wait for longer periods to get full featured product. As a result, nowadays new software development and testing framework is catching momentum i.e. Scrum approach.


In scrum, projects are divided in small features to be developed and tested in specific time-frames called as sprint (small cycles). Features should get developed and tested in specified small time-frames.  This agile scrum team is handled by scrum master.

Scrum is an iterative, incremental framework for projects and products or application development. Scrum has become more and more popular software development and testing framework among organizations. Many small to large sized IT companies have started to embrace Scrum framework, as this can create excellent quality products in less time than other traditional methodologies. This framework can save companies both time and money.

Source: ScrumAlliance

Advantages of Scrum from Client’s perspective

1. Deliver the highest business value features first
  •  Start using the prioritized functionalities which creates business value
2. Changes for free
  • You can change the features as you learn and see your product grow and there are options for still delivering business value at dates before the end of the project
3. Better time to market for new, differentiating ideas
4. Increasing Return On Investment
5. Potentially shippable Product delivery after every 1 or 4 weeks
  •          Frequently review ensure that what customer was expecting is what he is getting by monitoring the progress frequently
  •          Ability to set development priorities at the beginning of every sprint
  •          Need not to risk for committing and paying the funds without looking at actual progress of the delivery
  •          Ability to cancel the project at the end of any iteration if you are not happy and still have delivered business value
  •          As Customer is involved frequent reviews which updates him about the progress, good, bad. Based on the same Customer can change his minds without paying heavy costs 
6. Productivity increases

7. Avoid building features that will never be used by the customer

8. Determine the product cost based on the progress and during the development

9. Continuous improvement

  • ·   Scrum enables continuous, rapid, bottom-up reengineering
10. Leverages the chaos
  •         The product becomes a series of manageable chunks
  •         Progress is made, even when requirements are not stable
  •         Everything is visible to everyone
  •         Team communication improves
  •         The team shares successes along the way and at the end
  •         Customers see on-time delivery of increments
  •         A relationship with the customer develops, trust builds, and knowledge grows
  •         A culture is created where everyone expects the project to succeed 
11. Delivery high quality work

Agile Testing Concept

What is Agile Testing?
“Agile testing involves testing from the customer perspective as early as possible, testing early and often as code becomes available and stable enough from module/unit level testing.”

Agile Methodology
Agile methodology is a collection of values, principles, and practices that incorporates iterative development, test, and feedback into a new style of development.

Agile Values
      INDIVIDUALS & INTERACTION over Processes and tools
      Working Software over comprehensive documentation
      Customer Collaboration over Contract Negotiation
      Responding to change over following a Plan
From the above, it can be gauged that in an Agile Environment more importance is given to the team, interaction between the team members, Customers View, Customers Interaction, Customers Satisfaction, quality product & teams attitude towards the continuous changes to the software required throughout the Application development 

Key Difference between Agile and Traditional System
      Development is incremental rather than sequential. Software is developed in incremental, rapid cycles. This results in small, incremental releases, with each release building on previous functionality. Each release is thoroughly tested, which ensures that all issues are addressed in the next iteration.
      People and interactions are emphasized, rather than processes and tools. Customers, developers, and testers constantly interact with each other. This interaction ensures that the tester is aware of the requirements for the features being developed during a particular iteration and can easily identify any discrepancy between the system and the requirements.
      Working software is the priority rather than detailed documentation. Agile methodologies rely on face-to-face communication and collaboration, with people working in pairs. Because of the extensive communication with customers and among team members, the project does not need a comprehensive requirements document.
      Customer collaboration is used, rather than contract negotiation. All agile projects include customers as a part of the team. When developers have questions about a requirement, they immediately get clarification from customers.
      Responding to change is emphasized, rather than extensive planning. Extreme Programming does not preclude planning your project. However, it suggests changing the plan to accommodate any changes in assumptions for the plan, rather than stubbornly trying to follow the original plan.

Agile Methodology Approaches
      Extreme Programming
      Scrum
      Dynamic Systems Development Method (DSDM)
      Agile Modeling
      Adaptive Software Development (ASD)
      Agile Unified Process (AUP)
      Feature Driven Development (FDD)

Why we need Agile?
  1.         Cycle time to react to customer requirements is less
  2.         Complex requirements
  3.         International competition to GO LIVE
  4.         New Business Opportunities need exploration of new concepts

The Challenges in Agile Testing
Agile Testers face lot of challenges when they are working with Agile development team. A tester should be able to apply Root-Cause Analysis when finding severe bugs so that they unlikely to reoccur. While Agile has different flavors, Scrum is one process for implementing Agile. Some of the challenging scrum rules to be followed by every individual are
  •  Obtain Number of Hours Commitment Up Front
  •  Gather Requirements / Estimates Up Front
  •  Entering the actual hours and estimated hours daily.
  •  Daily Builds
  •  Keep the Daily Scrum meetings short
  •  Code Inspections are Paramount
So, in order to meet the above challenges, an agile tester needs to be innovative with the tools that they have. A great idea happens when what you have (tangible and intangible) meets the world’s deepest hunger.