Upload
srinivas-kantipudi
View
826
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
Eclipse UI Automation
Srinivas Kantipudi18 / 07 / 09
Workshop Overview
In this workshop, you will learn:• Ways to automate Eclipse based applications using UI Automation tools• Challenges in UI automation of Eclipse based applications• Different UI Automation tools• Different types of automation that can be performed with UI Automation tools
Workshop Overview, continued…
When you complete this workshop, you should be able to:• Understand basics of UI Automation tools• Ways to automate the functionality of Eclipse based applications• Ways to use UI Automation tools for Functional, Performance and Load testing• Tips and Tricks while doing UI Automation
Eclipse IDE
• Open, standards based environment• An IDE and more…
• Java development environment (JDT)• General tools and integration platform• General application platform (RCP)
• More than 1200 plug-ins just in Eclipse plugin central site•The real challenge of UI Automation starts here
OpenEdge Architect IDE
.NET Window Infragistics controls
Eclipse IDE
Apama Studio IDE
IDEs that use Graphical Framework
UI Automation Tools
Eclipse plug-ins• Squish – Supports Eclipse RCP/SWT/Swing• TPTP• WindowTester – Java UI, Swing and SWT
Other popular UI Automation tools• QuickTest Professional (QTP)• Rational Robot
QuickTest Professional
• Previously Mercury Interactive product, now taken over by HP• Supports only Windows OS• Scripting language based on VB Script• Supports .NET, Java, Web, XML, Main Frame, SAP, Siebel, PeopleSoft• Robust support for scripting• Stable
QuickTest Professional demo
• Creating Tests• Scripting• Debugging• Object repository• Running the application• Preparing Suites
Challenges with UI Automation of Eclipse
Challenge 1:Identification of every UI
object Uniquely
Lab 1 – 20 minutes
OverviewThe goal of this lab is to create a QTP script to create a Project,create a Java file in the project, select Link with Editor option fromPackage Explorer toolbar and verify that the project is created.
PrerequisitesQTP and Eclipse should be open.
Steps1. From Eclipse SDK, create a new Java Project.2. Create a new Java Class with the main method inside this project.3. Add a verification point to make sure file is created under the
project.4. Select “Link with Editor” option from Package explorer view
toolbar.
Discussion on Lab 1
• How did QTP recognize the Resources view?• What happens if the order of Views change?• How did QTP recognize the Toolbars?• Did we script to make sure the script passes in all conditions?• Did the Window title change in the course of Automation?• How are Toolbars recognized?
Challenges with UI Automation of Eclipse
Challenge 1:Identification of every UI
object Uniquely
Lab 1 – 20 minutes
Overview:The goal of this lab is to create a QTP script to create a Project,create a Java file in the project, select Link with Editor option fromPackage Explorer toolbar and verify that the project is created.
Prerequisites:QTP and Eclipse should be open.
Steps:1. From Eclipse SDK, create a new Java Project.2. Create a new Java Class with the main method inside this project.3. Add a verification point to make sure file is created under the
project.4. Select “Link with Editor” option from Package explorer view
toolbar.
Discussion on Lab 1
• How did QTP recognize the Resources view?• What happens if the order of Views change?• How did QTP recognize the Toolbars?• Did we script to make sure the script passes in all conditions?• Did the Window title change in the course of Automation?• How are Toolbars recognized?
Lab 1 - AnswerOption ExplicitDim PrjName, ClassFile, ClsName
PrjName = "Proj1"ClsName = "FirstClass"
'JavaTree description object --------------------------------------------------Dim gobjResourcesTViewSet gobjResourcesTView = Description.Create()gobjResourcesTView("developer name").Value = "Java(.*\n?)*"
JavaWindow("Java - Eclipse SDK").JavaMenu("File").JavaMenu("New").JavaMenu("Java Project").SelectJavaWindow("Java - Eclipse SDK").JavaWindow("New Java Project").JavaEdit("Project name:").Set PrjNameJavaWindow("Java - Eclipse SDK").JavaWindow("New Java Project").JavaButton("Finish").Click
wait(2)JavaWindow("Java - Eclipse SDK").JavaTree(gobjResourcesTView).OpenContextMenu PrjNameJavaWindow("Java - Eclipse SDK").WinMenu("ContextMenu").Select "New;Class"wait(1)
JavaWindow("Java - Eclipse SDK").JavaWindow("New Java Class").JavaEdit("Name:").Set ClsNameJavaWindow("Java - Eclipse SDK").JavaWindow("New Java Class").JavaButton("Finish").Click
wait(1)JavaWindow("Java - Eclipse SDK").JavaTree(gobjResourcesTView).Expand PrjName
'Checkpoint for verification of ABL Class file existing in resource tabClassFile = JavaWindow("Java - Eclipse SDK").JavaTree(gobjResourcesTView).GetROProperty("value")If InStr(ClassFile, ClsName) >= 1 Then
Reporter.ReportEvent micPass, "JavaTree - Resource","Class was created"else
Reporter.ReportEvent micFail,"JavaTree - Resource" , "Class was NOT created "End If
fnSetToolBarOptn ("Link with Editor")
Public Function fnSetToolBarOptn (pstrTBOptn)
Dim objDesc Dim objLists 'List of Toolbar items Dim i,j,strContent,strCheckIfExist
Set objDesc = Description.Create() objDesc("to_class").Value = "JavaToolbar"
Set objLists = JavaWindow("Java - Eclipse SDK").ChildObjects(objDesc)
j=objLists.count() i=0 For i=0 To j-1If objLists(i).GetItemscount()<>0 Then strContent =objLists(i).GetContent() strCheckIfExist =InStr(strContent,pstrTBOptn) If (strCheckIfExist) Then objLists(i).Press(pstrTBOptn) Exit For End IfEND IfNext
End Function 'fnSetToolBarOptn
Challenges with UI Automation of Eclipse
Challenge 2: Constant UI changes
Lab 2 – 10 minutes
Overview:The goal of this lab is to create a script to open Java Browsing
perspective or any other perspective.
Prerequisites:QTP and Eclipse should be open.
Steps:1. From Eclipse SDK, open Java Browsing perspective by
selecting Window -> Open Perspective -> Java Browsing.2. Add a verification point to check that Java Browsing
perspective is opened.
Discussion on Lab 1
• How did QTP recognize the Resources view?• What happens if the order of Views change?• How did QTP recognize the Toolbars?• Did we script to make sure the script passes in all conditions?• Did the Window title change in the course of Automation?• How are Toolbars recognized?
Eclipse IDE
• Open, standards based environment• An IDE and more…
• Java development environment (JDT)• General tools and integration platform• General application platform (RCP)
• More than 1200 plug-ins just in Eclipse plugin central site•The real challenge of UI Automation starts here
Eclipse IDE
• Open, standards based environment• An IDE and more…
• Java development environment (JDT)• General tools and integration platform• General application platform (RCP)
• More than 1200 plug-ins just in Eclipse plugin central site•The real challenge of UI Automation starts here
Eclipse IDE
• Open, standards based environment• An IDE and more…
• Java development environment (JDT)• General tools and integration platform• General application platform (RCP)
• More than 1200 plug-ins just in Eclipse plugin central site•The real challenge of UI Automation starts here