If you fondly remember the days of simple HTML applications as you struggle with Web 2.0 and rich internet applications (RIA) that utilize technologies like AJAX, Adobe Flex and Flash, and Microsoft Silverlight, then you should attend this session. We’ll show you a proven approach to automating AJAX-based applications using HP QuickTest Professional, starting with a brief introduction to out-of-the-box Web 2.0 test capabilities and other tools to support new Web 2.0 toolkits. We’ll cover the HP Web 2.0 Feature Pack, and we’ll discuss the new HP Extensibility Accelerator for functional testing which provides an environment to speed the development of Web Add-in Extensibility toolkit support sets that are not supported out of the box. The session will include examples based on AJAX applications built with the Google Web Toolkit (GWT). GWT-based applications are notoriously hard to automate because of non-traditional HTML objects and synchronization, and make good examples of the challenges you might face.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
No common design framework between GWT applications
Can‟t view HTML using View Source
It is a Microsoft add-on for IE6 and IE7 that aimed to aid in design and debugging of web pages. It is included in IE8.
It allows to view DOM and CSS structures
Firebug is a similar tool for Firefox
Automated tools “see” all the objects in CSS-based applications, even if objects are hidden
CSS uses “display” property to hide parts of HTML page
To verify if object or part of HTML page is visible use “Style.display” and “CurrentStyle.display” properties
CurrentStyle.Display = “block” „visible
CurrentStyle.Display = “none” „not visible
Public Function Web_DisplayCSS(byVal WebObj)
Dim bDisplayed: bDisplayed = True
Set WebObj = WebObj.Object
Do
If WebObj.Style.Display ="none" or WebObj.CurrentStyle.Display="none" Then
bDisplayed = False
Exit Do
End If
Set WebObj = WebObj.ParentNode
Loop while Not (WebObj is Nothing) AND WebObj.NodeName<>"#document"
Web_DisplayCSS = bDisplayed
End Function
By default GWT doesn‟t generate the useful web object properties, like “html id” or “name” for object recognition mechanism of GUI test tools
It is highly recommended to work with development team to get a unique static value assigned to web objects
<DIV> - WebElements (children)
<IMG> - Image
<INPUT> - WebEdit
<DIV> - WebElement (parent)
Tree
Grid
Browser‟s Status Bar isn‟t relevant for GWT applications since page is not getting reloaded
Verify that Object existIf .WeEdit(“”).Exist(seconds) …
Page sync – count number of objects on the page and verify that count doesn‟t changed several times in a row
Use AJAX “Please Wait” Wheel object or similar objects
Dynamic Object contents – sync on object propertiesBrowser("").WebList("").WaitProperty,"items count", micGreaterThanOrEqual(5)
More on this topic (QTP info):http://relevantcodes.com/qtp-synchronization-for-ajax-applications/http://www.vidbob.com/qtp/ajax-and-javascript-toolkits.html
• “Out of the box” support for the most common Web 2.0
technologies, including:
-Silverlight 3.0
- Ajax toolkits:
-ASP.NET AJAX (from Microsoft)
-GWT (from Google)
-YUI (from Yahoo)
-Dojo (open source)
•New Extensibility Accelerator (EA) for Functional Testing
to provide fast and easy FT add-in extensibility
It is very advanced – you need to know JavaScript and XML
Troubleshooting is difficult
Add-in Distribution/Redistribution – it needs to be install/reinstall on each test box
Time Consuming
Setting.WebPackage("ReplayType")◦ 1 - Runs mouse operations using browser events.
◦ 2 - Runs mouse operations using the mouse.
Example enabling “Save” button:Setting.WebPackage("ReplayType") = 2„ next line will enable “Save” button.WebList("class:=gwt-ListBox").Select “First”Setting.WebPackage("ReplayType") = 1If .WebButton("Save").GetRoProperty(“disabled”) Then….Another use of this technique – getting Tooltips from GWT
objects
Test Automation for Web 2.0 RIA applications is more challenging than automating traditional Web applications
Cooperation with development team is essential for automation success
RIA applications aren‟t look alike because of variety of widget sets can be used for development
Advanced test automation expertise is required
Rich Seeley - “How to sort out Ajax and RIA frameworks”
Paul Tuohy - “What Is AJAX?” www.ajaxwith.com Wikipedia www.qaforums.com www.advancedqtp.com www.vidbob.com http://download.instantiations.com/D2WBDoc/con