GWT New Kid on the Block Igor Gershovich Connected Testing Inc wwwconnectedtestingcom Often feature a rich userfriendly interface based Rich Internet Application RIA technologies such as Ajax Flex Silverlight ID: 390919
Download Presentation The PPT/PDF document "Automating Web 2.0 Rich Internet Applica..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Automating Web 2.0 Rich Internet Applications (RIA).GWT – New Kid on the Block.
Igor Gershovich
Connected Testing, Inc.
www.connectedtesting.comSlide2Slide3
Often feature a rich, user-friendly interface based Rich Internet Application (RIA) technologies such as Ajax, Flex, Silverlight.Are Web Applications with some features of desktop applicationsCommunicate with server applications, and use a plug-in or browser technologies in addition to or instead of HTML and CSS. Web 2.0 applications:Slide4
Adobe Flash/FlexGoogle Web Toolkit (GWT)Microsoft SilverlightdojoCurljQueryAnd 200 or 300 othersRIA Frameworks/ToolkitsSlide5
Most of Rich Internet are based on AJAX (Asynchronous JavaScript + XML) technologyMicrosoft Silverlight and Adobe Flex have proprietary runtime technologiesRIA technologiesSlide6
RIA Youtube.com relies on Adobe Flash for Video playbackSlide7
AJAX is a technique that combines and exploits some long-standing Web technologies:Using XHTML and Cascading Style Sheets (CSS) for structure and presentation. Displaying and manipulating pages using the Document Object Model (DOM). Using the browser's XMLHttpRequest object to transfer data between the client and the server. Using XML as the format for the data flowing between the client and the server.
Using JavaScript to dynamically display and interact with all of the above.
What is AJAX?Slide8
AJAX allows the server to update the current Web page as opposed to sending a new pageThe single page interface increases user interactivityAdvantages of AJAXSlide9
Some search engines are not equipped for AJAX-based applicationsCan be too much context on one pageBookmarks, Browser’s Back or Forward navigation may not function as expectedDisadvantages of AJAXSlide10
Simple AJAX application
Clicking on Adelie
Information From ServerSlide11
This is what happened behind the screen after clicking on link
Internet
Server
Client
4. Client processes XML Doc
using JScript and updates
Web page
3. Server sends HTTP
Response With XML Data
1. Client creates XmlHttpRequest
object using JScript then sends
HTTP request
2. Server processes the
HTTP requestSlide12
Google Web Toolkit (GWT) is a framework for Java Developers to develop AJAX Web ApplicationsThere are numerous widget libraries available for GWTWhat is GWT?Slide13
The developer uses Google Web Toolkit (GWT) to write AJAX front-end in the Java programming languageWhen it is ready to deploy, GWT compiles Java source code into optimized, standalone JavaScript files. How GWT works in a nutshellSlide14
GWT Application exampleSlide15
Automating GWT-based applicationsSlide16
Custom or 3rd party Web controlsNo unique object propertiesSynchronization for AJAXCascading Style Sheets (CSS)No common design framework between GWT applicationsCan’t view HTML using View Source
ChallengesSlide17
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 structuresFirebug is a similar tool for FirefoxIE Developer toolbarSlide18
IE6/IE7 Developer ToolsSlide19
Automated tools “see” all the objects in CSS-based applications, even if objects are hiddenCSS uses “display” property to hide parts of HTML pageTo 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
CSS considerations Slide20
By default GWT doesn’t generate the useful web object properties, like “html id” or “name” for object recognition mechanism of GUI test toolsIt is highly recommended to work with development team to get a unique static value assigned to web objectsObject propertiesSlide21
Combobox is a collection of objects
<DIV> - WebElements (children)
<IMG> - Image
<INPUT> - WebEdit
<DIV> - WebElement (parent)Slide22
Custom controls: Grids, Comboboxes, Trees…
Tree
GridSlide23
Browser’s Status Bar isn’t relevant for GWT applications since page is not getting reloadedVerify that Object exist If .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 properties
Browser("").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
Synchronization for AJAX objectsSlide24
EXT GWT(GXT) controlsSlide25
Automating GWT-based applications with HP QTPBonus InformationSlide26
What people really want to ask: Does QTP work with custom objects from various JavaScript toolkits?Does QTP support AJAX?Slide27
There are 2 ways to work with custom objects:QTP Web-Extensibility add-in. It enables you to develop custom support for third-party and custom Web controls that are not supported out-of-the-boxTraditional approach – coding (Functions/Classes)Working with Custom objectsSlide28
To manipulate these objects we need to define custom methods and propertiesHere are excellent articles on this topic:AJAX and JavaScript tools – Web Extensibility and Traditional approach examples for custom grids - www.vidbob.com“Web Extensibility Lesson – Building a toolkit Support” for combobox at
www.advancedqtp.com
Custom controls: Grids, Combo-boxes, Trees…Slide29
Panels/Dialog boxes - no Web Extensibility
Dialog box Included in Object Hierarchy. Object
Repository/Descriptive Programming approach
Dialog box excluded from Object Hierarchy
Dialog box Included in Object Hierarchy. Object
Repository only approach. Btn_Tags object moved
Manually under Dialog box in OR hierarchySlide30
HP QTP Web Extensibility• “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 Slide31
Panels/Dialog boxes with Web ExtensibilitySlide32
It is very advanced – you need to know JavaScript and XMLTroubleshooting is difficultDistribution/Redistribution challenges – Custom Add-in needs to be install/reinstall on each test boxTime ConsumingProblems with Web Extensibility add-inSlide33
10.0 Extensibility AcceleratorSlide34
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") = 1
If .WebButton("Save").GetRoProperty(“disabled”) Then
….
Another use of this technique – getting Tooltips from GWT objects
Changing QTP Web ReplayType from Event to Keyboard/MouseSlide35
Test Automation for Web 2.0 RIA applications is more challenging than automating traditional Web applicationsCooperation with development team is essential for automation successRIA applications aren’t look alike because of variety of widget sets can be used for developmentAdvanced test automation expertise is required
ConclusionsSlide36
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/continuous/latest/docs/html/features/gwt/gxt.htm
ResourcesSlide37
Company: Connected Testing, Inc.E-Mail: igershovich@connectedtesting.comPhone: 720-933-9395Website: www.connectedtesting.com
Igor Gershovich