Tellurium 0.7.0 presentation

2,062 views

Published on

Tellurium 0.7.0 features introduction.

Published in: Technology
2 Comments
2 Likes
Statistics
Notes
  • Really appreciate your comment. Will add that. Thanks.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Great project , keep up the good work :) !!
    i would have added a slide listing the pros of tellurium vs selenium
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
2,062
On SlideShare
0
From Embeds
0
Number of Embeds
86
Actions
Shares
0
Downloads
48
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Tellurium 0.7.0 presentation

  1. 1. Tellurium 0.7.0 Jian Fang @telluriumsource.org
  2. 2. Outline <ul><li>Tellurium Overview </li></ul><ul><li>Deep Dive into Tellurium </li></ul><ul><li>Tellurium Advanced Topics </li></ul><ul><li>Summary </li></ul>
  3. 3. Part I: Tellurium Overview
  4. 4. What is Tellurium? <ul><li>Tellurium Automated Testing Framework is an automated web testing framework grew up from the Selenium framework with different focuses. </li></ul><ul><ul><li>Focus on a group of UI elements, i.e., widget </li></ul></ul><ul><ul><li>Expressiveness </li></ul></ul><ul><ul><li>Test robust </li></ul></ul><ul><ul><li>Dynamic web context </li></ul></ul><ul><ul><li>Easy to Maintain </li></ul></ul>
  5. 5. Why Tellurium is Novel <ul><li>Most existing frameworks focus on individual UI elements </li></ul><ul><li>Tellurium treat the group of elements as a whole (called a UI module) </li></ul>
  6. 6. How Challenges are addressed in Tellurium <ul><li>Expressiveness </li></ul><ul><ul><li>Groovy DSLs </li></ul></ul><ul><ul><li>UI definition, actions, data access, and test support </li></ul></ul><ul><li>Test Robust </li></ul><ul><ul><li>Do not define locators directly </li></ul></ul><ul><ul><li>dynamically generate runtime locators from UI attributes. </li></ul></ul><ul><ul><li>Partial UI module matching in new Tellurium Engine </li></ul></ul>
  7. 7. How Challenges are addressed in Tellurium (Cont'd) <ul><li>Dynamic Web Content </li></ul><ul><ul><li>UI templates for Data Grids such as List and Table </li></ul></ul><ul><ul><li>UID Description Language (UDL) represents dynamic factors in UI modules </li></ul></ul><ul><ul><li>respond attribute for JavaScript events </li></ul></ul><ul><li>Easy to Maintain </li></ul><ul><ul><li>No hard-coded locators in test code </li></ul></ul><ul><ul><li>Separation of UI definition and test code </li></ul></ul><ul><ul><li>UI Module class for UI definition and UI methods </li></ul></ul>
  8. 8. Tellurium Main Features <ul><li>Abstract Groovy UI objects to encapsulate web UI elements </li></ul><ul><li>UI modules and widgets for structured test code and re-usability </li></ul><ul><li>DSL for UI definition, actions, data access, and testing </li></ul><ul><li>Dynamically generate runtime locator to localize changes </li></ul><ul><li>UI templates for dynamic web contents </li></ul><ul><li>CSS selector is the default locator </li></ul><ul><li>Macro command bundles multiple API calls to reduce round trip overhead </li></ul><ul><li>UI module group locating and caching for test robust and better speed </li></ul><ul><li>UID Description Language makes it easy to represent dynamic factors in UI module </li></ul><ul><li>New jQuery-based testing driving Engine </li></ul><ul><li>Data driven testing support </li></ul>
  9. 9. Tellurium Sub-projects <ul><li>Engine : New test driving engine with UI group locating, CSS selector, and command bundle </li></ul><ul><li>UDL : UID Description Language Parser </li></ul><ul><li>Core : DSL, APIs, object to runtime locator mapping, and test support </li></ul><ul><li>Widgets : Dojo and ExtJS widgets </li></ul><ul><li>Trump : Tellurium UI module firefox plugin </li></ul><ul><li>Maven Archetypes : create tellurium projects with Maven </li></ul><ul><li>Reference projects : Tellurium examples </li></ul>
  10. 10. Tellurium History <ul><li>Prototyped in June 2007 </li></ul><ul><li>Open sourced in June 2008 </li></ul><ul><li>Latest release 0.7.0 in May 2010 </li></ul>
  11. 11. Tellurium Architecture <ul><li>Tellurium Core : Object to runtime locator mapping, event handling, and command bundling </li></ul><ul><li>Tellurium Engine : Testing driving, group locating and UI module caching </li></ul>
  12. 12. How Tellurium Works: Selenium Wrapper <ul><li>Tellurium Core generates runtime locator and then call Selenium APIs </li></ul>
  13. 13. How Tellurium Works: Tellurium Way <ul><li>UI module group locating and caching in Engine </li></ul><ul><li>Tellurium new APIs </li></ul>
  14. 14. How to Obtain Tellurium <ul><li>Download Tellurium 0.7.0 Release tar ball http://aost.googlecode.com/files/tellurium-0.7.0.tar.gz </li></ul><ul><li>Create Tellurium Maven project with tellurium-junit-archetype or tellurium-testng-archetype </li></ul><ul><li>mvn archetype:create -DgroupId=your_group_id -DartifactId=your_artifact_id </li></ul><ul><li>-DarchetypeArtifactId=tellurium-junit-archetype </li></ul><ul><li>-DarchetypeGroupId=org.telluriumsource -DarchetypeVersion=0.7.0 </li></ul><ul><li>-DarchetypeRepository=http://maven.kungfuters.org/content/repositories/releases </li></ul>
  15. 15. How to Use Tellurium <ul><li>Create Tellurium test project </li></ul><ul><li>Create UI modules </li></ul><ul><li>Create Test cases </li></ul>
  16. 16. Part II: Deep Dive into Tellurium
  17. 17. UI Module <ul><li>Explicitly shows what UI you are testing </li></ul><ul><li>UI module represents a composite UI object in the format of nested basic UI elements. </li></ul><ul><li>UI module definition is expressive, for example: </li></ul><ul><li>ui.Container(uid: &quot;GoogleSearchModule&quot;, clocator: [tag: &quot;td&quot;], group: &quot;true&quot;){ </li></ul><ul><li>InputBox(uid: &quot;Input&quot;, clocator: [title: &quot;Google Search&quot;]) </li></ul><ul><li>SubmitButton(uid: &quot;Search&quot;, clocator: [name: &quot;btnG&quot;, value: &quot;Google Search&quot;]) </li></ul><ul><li>SubmitButton(uid: &quot;ImFeelingLucky&quot;, clocator: [value: &quot;I'm Feeling Lucky&quot;]) </li></ul><ul><li>} </li></ul><ul><li>UI module class includes UI methods </li></ul><ul><li>Tellurium core automatically generates runtime locator from the clocators in UI module </li></ul>
  18. 18. UI Object Identifier <ul><li>UI object Identifier (UID) is used to reference UI objects in UI module </li></ul><ul><li>Each object's UID is a cascade of its ancestors' ids and its own id </li></ul><ul><li>List and Table elements can be referenced by indices or ids </li></ul><ul><li>UID removes the need to reference locators directly in test code. </li></ul><ul><li>type &quot;GoogleSearchModule.Input&quot;, &quot;Tellurium test&quot; </li></ul><ul><li>click &quot;GoogleSearchModule.Search&quot; </li></ul>
  19. 19. Composite Locator <ul><li>Composite Locator, i.e., clocator, is a set of UI attributes used to describe a Web UI element </li></ul><ul><li>Groovy class definition is as follows </li></ul><ul><li>class CompositeLocator { </li></ul><ul><li>String header </li></ul><ul><li>String tag </li></ul><ul><li>String text </li></ul><ul><li>String trailer </li></ul><ul><li>def position </li></ul><ul><li>Map<String, String> attributes = [:] </li></ul><ul><li>} </li></ul><ul><li>Tellurium Core automatically generates the runtime locator, either xpath or css selector, from the clocator </li></ul>
  20. 20. Group Locating <ul><li>The main idea of group locating is to use the relationship among UI objects in the UI module to locate them. </li></ul><ul><li>Instead of “find the Form on the web” </li></ul><ul><li>Consider “find the Form whose children include two Inputs and one selector” </li></ul><ul><li>The Santa algorithm locates the UI module as a whole </li></ul>
  21. 21. UI Templates <ul><li>UI templates are used to describe </li></ul><ul><ul><li>Unknown number of UI elements, but the types are known </li></ul></ul><ul><ul><li>Many and similar UI elements </li></ul></ul><ul><li>List and Table objects use UI templates </li></ul><ul><li>UDL defines the grammar of UI template definition. </li></ul><ul><li>ui.Table(uid: &quot;issueResult&quot;, clocator: [id: &quot;resultstable&quot;]) { </li></ul><ul><li>UrlLink(uid: &quot;{header: any} as Extra&quot;, clocator: [text: &quot;*...&quot;]) </li></ul><ul><li>TextBox(uid: &quot;{row: all, column -> Extra}&quot;, clocator: [:]) </li></ul><ul><li>UrlLink(uid: &quot;{row: all, column: all}&quot;, clocator: [:]) </li></ul><ul><li>} </li></ul>
  22. 22. Tellurium UI Object <ul><li>UI objects are an abstraction of the web UI elements. </li></ul><ul><li>UI object main attributes: </li></ul><ul><ul><li>uid : identifier in UDL syntax </li></ul></ul><ul><ul><li>namespace : for XHTML </li></ul></ul><ul><ul><li>locator : </li></ul></ul><ul><ul><ul><li>clocator: Object attributes </li></ul></ul></ul><ul><ul><ul><li>base locator: predefined xpath or CSS selector </li></ul></ul></ul><ul><ul><li>group : group locating option </li></ul></ul><ul><ul><li>respond : JavaScript events </li></ul></ul><ul><li>ui.Table(uid: &quot;issueResult&quot;, clocator: [id: &quot;resultstable&quot;, class: &quot;results&quot;], group: &quot;true&quot;) </li></ul>
  23. 23. Tellurium Predefined Objects
  24. 24. Tellurium Widgets <ul><li>Tellurium provides you the capability to group UI objects into a widget object and then you can use the widget directly just like using a tellurium UI object. </li></ul><ul><ul><li>Reusable </li></ul></ul><ul><ul><li>Name space to avoid name collision </li></ul></ul><ul><ul><li>Compiled as a jar file </li></ul></ul><ul><ul><li>Load from Tellurium configuration file </li></ul></ul><ul><li>Tellurium provides an onWidget method to call widget methods. </li></ul><ul><li>Example: Dojo Datepicker. </li></ul><ul><li>ui.Form(uid: &quot;dropdown&quot;, clocator: [:], group: &quot;true&quot;){ </li></ul><ul><li>Image(uid: &quot;selectDate&quot;, clocator: [title: &quot;select a date&quot;, alt: &quot;date&quot;]) </li></ul><ul><li>DOJO_DatePicker(uid: &quot;datePicker&quot;, clocator: [tag: &quot;div&quot;, dojoattachpoint: &quot;subWidgetContainerNode&quot;]) </li></ul><ul><li>} </li></ul><ul><li>onWidget &quot;dropdown.datePicker&quot;, selectPrevYear </li></ul>
  25. 25. Domain Specific Language <ul><li>The DSL is the heart of the Tellurium and all UI module classes must extend the DslContext class </li></ul><ul><li>Defines DSL expression, for instance, “click uid” </li></ul><ul><li>DSL context includes </li></ul><ul><ul><li>UI object definitions </li></ul></ul><ul><ul><li>event actions </li></ul></ul><ul><ul><li>data access </li></ul></ul><ul><ul><li>Test support </li></ul></ul><ul><li>DslContext is extended to support Data Driven Testing, which includes input file layout, test definition, and testing flow. </li></ul>
  26. 26. Tellurium Test Support <ul><li>Test Cases </li></ul><ul><ul><li>Tellurium Groovy Test Case </li></ul></ul><ul><ul><li>Tellurium JUnit Test Case (JUnit 4 annotations) </li></ul></ul><ul><ul><li>Tellurium TestNG Test Case (TestNG annotations) </li></ul></ul><ul><ul><li>Pure DSL Script </li></ul></ul><ul><li>Data Driven Testing </li></ul><ul><ul><li>Separate test data from test script </li></ul></ul><ul><ul><li>Data providers </li></ul></ul><ul><ul><li>UI module, input file layout, test definition </li></ul></ul><ul><ul><li>Test flow control </li></ul></ul>
  27. 27. Tellurium UI Module Plugin <ul><li>Trump is a Firefox plugin to automatically generate UI modules </li></ul><ul><li>Record user clicks and then generate UI module </li></ul><ul><li>Can export to a Groovy file </li></ul>
  28. 28. How Trump Works <ul><li>Record user clicks </li></ul><ul><li>Generate UI module </li></ul><ul><li>Customize UI module </li></ul><ul><li>Validate UI module </li></ul>
  29. 29. Demo
  30. 30. Part III: Tellurium Advanced Topics
  31. 31. Marco Command <ul><li>Bundle a set of API calls into one call </li></ul><ul><li>Processed by the bundle processor in Tellurium Core automatically </li></ul><ul><li>Tellurium Engine decodes and runs each API call </li></ul><ul><li>Reduce round trip overhead to Tellurium Engine </li></ul>
  32. 32. Santa Algorithm <ul><li>Santa algorithm is used to locate the whole UI module </li></ul><ul><li>Basically a branch and trim search procedure on the runtime DOM </li></ul><ul><li>Multiple match reduction mechanism: </li></ul><ul><ul><li>Mark </li></ul></ul><ul><ul><li>Look Ahead </li></ul></ul><ul><ul><li>Look Id </li></ul></ul><ul><ul><li>Best Effort </li></ul></ul><ul><li>Relax: partial match with a match score </li></ul>
  33. 33. UID Description Language <ul><li>UDL grammars define the UIDs for different types of UI objects </li></ul><ul><ul><li>UI objects without UI templates </li></ul></ul><ul><ul><li>List </li></ul></ul><ul><ul><li>Table </li></ul></ul><ul><li>ID: starts with a letter and is followed by digits, letters, and &quot;_&quot; </li></ul><ul><li>Index includes “first”, “last”, “any”, “odd”, “even”, “all”, and digits </li></ul><ul><li>Routing: rtree and rgraph </li></ul>
  34. 34. UI Module Caching <ul><li>UI module is converted into a JSON object </li></ul><ul><li>Santa algorithm locates the UI module </li></ul><ul><li>UI module is cached for later access </li></ul><ul><li>Caching can be turned on and off by the call </li></ul><ul><li>void useCache(boolean isUse) </li></ul><ul><li>Cache eviction policies </li></ul><ul><ul><li>Discard old </li></ul></ul><ul><ul><li>Discard new </li></ul></ul><ul><ul><li>Discard least used </li></ul></ul><ul><ul><li>Discard invalid </li></ul></ul><ul><li>Get Cache usage </li></ul><ul><li>Map<String, Long> getCacheUsage() </li></ul>
  35. 35. Internationalization Support <ul><li>Provides support for internationalization of strings and exception messages. </li></ul><ul><li>I18n support is provided by message bundle </li></ul><ul><li>Set locale in Tellurium configuration file </li></ul><ul><li>i18n{ </li></ul><ul><li>locales = &quot;en_EN&quot; </li></ul><ul><li>} </li></ul>
  36. 36. Powerful Utilities <ul><li>Show the generated runtime locators </li></ul><ul><li>void dump(String uid) </li></ul><ul><li>Diagnose UI definition </li></ul><ul><li>void diagnose(String uid) </li></ul><ul><li>Validate UI module </li></ul><ul><li>void validate(String uid) </li></ul><ul><li>UI Module partial match </li></ul><ul><li>void useClosestMatch(boolean isUse) </li></ul><ul><li>Turn on and off Tellurium Engine Log </li></ul><ul><li>void useEngineLog(boolean isUse) </li></ul><ul><li>Get runtime HTML source </li></ul><ul><li>void getHTMLSource(String uid) </li></ul><ul><li>Visualize UI module </li></ul><ul><li>void show(String uid, int delay) </li></ul><ul><li>Turn on and off execution time trace </li></ul><ul><li>void useTrace(boolean isUse) </li></ul>
  37. 37. Part IV: Summary
  38. 38. Future Directions <ul><li>Finish up jQuery-base Tellurium APIs </li></ul><ul><li>Tellurium widget improvement </li></ul><ul><li>Trump upgrade to automatically generate testing DSL script </li></ul><ul><li>Testing workflow support </li></ul><ul><li>Behavior driven testing support </li></ul><ul><li>Tellurium as a cloud testing tool </li></ul><ul><li>Tellurium as a web security testing tool </li></ul><ul><li>IDE and other plugins </li></ul>
  39. 39. Resources <ul><li>Tellurium Project Site </li></ul><ul><li>http://code.google.com/p/aost/ </li></ul><ul><li>Tellurium on twitter </li></ul><ul><li>http://twitter.com/TelluriumSource </li></ul><ul><li>TelluriumSource </li></ul><ul><li>http://telluriumsource.org </li></ul><ul><li>Tellurium user group </li></ul><ul><li>http://groups.google.com/group/tellurium-users </li></ul><ul><li>Tellurium 0.7.0 Release tar ball </li></ul><ul><li>http://aost.googlecode.com/files/tellurium-0.7.0.tar.gz </li></ul><ul><li>Tellurium 0.7.0 Reference Documentation </li></ul><ul><li>http://aost.googlecode.com/files/tellurium-reference-0.7.0.pdf </li></ul>

×