Eclipse UI automation

1,627 views

Published on

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

Eclipse UI automation

  1. 1. Eclipse UI AutomationSrinivas Kantipudi18 / 07 / 09
  2. 2. Workshop OverviewIn this workshop, you will learn:• Ways to automate Eclipse based applications using UIAutomation tools• Challenges in UI automation of Eclipse basedapplications• Different UI Automation tools• Different types of automation that can be performed withUI Automation tools
  3. 3. Workshop Overview, continued…When you complete this workshop, you should beable to:• Understand basics of UI Automation tools• Ways to automate the functionality of Eclipse basedapplications• Ways to use UI Automation tools for Functional,Performance and Load testing• Tips and Tricks while doing UI Automation
  4. 4. 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 plugincentral site•The real challenge of UI Automation starts here
  5. 5. OpenEdge Architect IDE.NET Window Infragistics controlsEclipseIDE
  6. 6. Apama Studio IDE
  7. 7. IDEs that use Graphical Framework
  8. 8. UI Automation ToolsEclipse plug-ins• Squish – Supports Eclipse RCP/SWT/Swing• TPTP• WindowTester – Java UI, Swing and SWTOther popular UI Automation tools• QuickTest Professional (QTP)• Rational Robot
  9. 9. QuickTest Professional• Previously Mercury Interactive product, nowtaken 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
  10. 10. QuickTest Professional demo• Creating Tests• Scripting• Debugging• Object repository• Running the application• Preparing Suites
  11. 11. Challenges with UI Automation ofEclipseChallenge 1:Identification of every UIobject Uniquely
  12. 12. Lab 1 – 20 minutesOverviewThe 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 theproject.4. Select “Link with Editor” option from Package explorer viewtoolbar.
  13. 13. 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 allconditions?• Did the Window title change in the course ofAutomation?• How are Toolbars recognized?
  14. 14. Challenges with UI Automation ofEclipseChallenge 1:Identification of every UIobject Uniquely
  15. 15. Lab 1 – 20 minutesOverview: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 theproject.4. Select “Link with Editor” option from Package explorer viewtoolbar.
  16. 16. 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 allconditions?• Did the Window title change in the course ofAutomation?• How are Toolbars recognized?
  17. 17. Lab 1 - AnswerOption ExplicitDim PrjName, ClassFile, ClsNamePrjName = "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("JavaProject").SelectJavaWindow("Java - Eclipse SDK").JavaWindow("New Java Project").JavaEdit("Projectname:").Set PrjNameJavaWindow("Java - Eclipse SDK").JavaWindow("New Java Project").JavaButton("Finish").Clickwait(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:").SetClsNameJavaWindow("Java - Eclipse SDK").JavaWindow("New Java Class").JavaButton("Finish").Clickwait(1)JavaWindow("Java - Eclipse SDK").JavaTree(gobjResourcesTView).Expand PrjNameCheckpoint for verification of ABL Class file existing in resource tabClassFile = JavaWindow("Java - EclipseSDK").JavaTree(gobjResourcesTView).GetROProperty("value")If InStr(ClassFile, ClsName) >= 1 ThenReporter.ReportEvent micPass, "JavaTree - Resource","Class was created"elseReporter.ReportEvent micFail,"JavaTree - Resource" , "Class was NOT created "End IffnSetToolBarOptn ("Link with Editor")Public Function fnSetToolBarOptn(pstrTBOptn)Dim objDescDim objLists List of Toolbar itemsDim i,j,strContent,strCheckIfExistSet objDesc = Description.Create()objDesc("to_class").Value ="JavaToolbar"Set objLists = JavaWindow("Java -Eclipse SDK").ChildObjects(objDesc)j=objLists.count()i=0For i=0 To j-1If objLists(i).GetItemscount()<>0 ThenstrContent =objLists(i).GetContent()strCheckIfExist=InStr(strContent,pstrTBOptn)If (strCheckIfExist) ThenobjLists(i).Press(pstrTBOptn)Exit ForEnd IfEND IfNextEnd Function fnSetToolBarOptn
  18. 18. Challenges with UI Automation ofEclipseChallenge 2:Constant UI changes
  19. 19. Lab 2 – 10 minutesOverview:The goal of this lab is to create a script to open Java Browsingperspective or any other perspective.Prerequisites:QTP and Eclipse should be open.Steps:1. From Eclipse SDK, open Java Browsing perspective byselecting Window -> Open Perspective -> Java Browsing.2. Add a verification point to check that Java Browsingperspective is opened.
  20. 20. 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 allconditions?• Did the Window title change in the course ofAutomation?• How are Toolbars recognized?
  21. 21. 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 plugincentral site•The real challenge of UI Automation starts here
  22. 22. 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 plugincentral site•The real challenge of UI Automation starts here
  23. 23. 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 plugincentral site•The real challenge of UI Automation starts here

×