SlideShare une entreprise Scribd logo
1  sur  55
Télécharger pour lire hors ligne
Tellurium Automated Web
    Testing Framework

          Jian Fang
 (John.Jian.Fang@gmail.com)

      Vivek Mongolu
(vivekmongolu@gmail.com)
Who are these guys?

   Jian Fang
       Senior Software engineer @ Jewelry Television
       Enterprise Applications focusing on the server side
       Tellurium Project Lead
   Vivek Mongolu
       Software engineer @ Jewelry Television
       Enterprise Applications focusing on the server side
        and client side
       Tellurium Project Member
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium’s solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin(Trump)

    Projects

    0.7.0 Feature Preview

    Resources
What is Tellurium?

   Tellurium is a UI module based web testing
    framework built on top of Selenium (currently building
    our own testing engine).
   Open source. http://code.google.com/p/aost/
   Tellurium is implemented in Groovy and Java
   Tellurium includes a set of Domain Specific
    Languages (DSLs) to define UI, actions, and tests
   UI is defined in Groovy class and tests can be written
    in
        Java (JUnit 4 or TestNG)
        Groovy
        Pure DSL script
Tellurium History

    2007-06-01, first prototype

    2008-01-01, second prototype

    2008-07-12, release 0.3.0

    2008-08-13, release 0.4.0

    2008-12-03, release 0.5.0

    2009-06-18, release 0.6.0

    2010-02-15, release 0.7.0 (projected)
Tellurium Main Features

    UI module for structured test code and re-usability

    Composite Locator to use a set of attributes to describe a UI
    element

    Group locating to exploit information inside a collection of UI
    components

    UI templates for dynamic web content

    JQuery selector support to improve test speed in IE

    Data driven testing support

    Selenium Grid support

    JUnit and TestNG support

    Maven support
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium’s solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin(Trump)

    Projects

    0.7.0 Feature Preview

    Resources
Selenium

   Selenium is a suite of tools to automate web
    app testing across many platforms.
        Selenium Core: DHTML test execution
         framework
        Selenium IDE: Firefox extension – record and
         playback
        Selenium Remote Control
              Server: launches/kills browser, HTTP Proxy
              Client libraries
        Selenium Grid
              Run Selenium tests in parallel
1.     The client/driver reaches out to the
                                     selenium-server.
                              2.     Selenium-Server launches a browser
                                     with a URL that will load Selenium core
                                     web page.
                              3.     Selenium-Core gets the first instruction
                                     from the client/driver (via the HTTP
                                     Proxy built into the Selenium RC
                                     Server).
                              4.     Selenim-Core acts on that first
                                     instruction, typlically opening a page of
                                     the AUT.
                              5.     Web server is asked for that page, and
                                     it renders in the frame/window resered
                                     for it.

http://seleniumhq.org/documentation/remote-control/how-it-works.html
What’s wrong with Selenium




    Simple BookStore App – Create Book
           The above UI includes Create Book module with
            three text boxes, one select box and one button
           Use Selenium IDE and it generates the following
            Selenium test case
    Groovy Recipes: Greasing the Wheels of Java by Scott Davis
package com.selenium.bookapp.test;

public class SeleniumCreateBookTestCase extends SeleneseTestCase {
    public void setUp() throws Exception {
        setUp("http://localhost:8080/BooksApp/", "*chrome");
    }

    public void testNew() throws Exception {
         selenium.open("book/create");
        selenium.type("title", "Tellurium");
        selenium.type("author", "Jian and Vivek");
        selenium.type("pages", "100");
        selenium.select("category", "label=Technical");
        selenium.click("//input[@value='Create']");
        selenium.waitForPageToLoad("30000");

        Assert.assertEquals(1,
               selenium.getXpathCount("/html/body/div[4]/div[1]"));


    }
}
Selenium RC Demo
What do you observe?
     Verbose
               selenium everywhere
               Locators everywhere
     Coupling
               UI locators, actions, and assertions
are coupled                                                 selenium.open("/book/create");
                                                            selenium.type("title", "Tellurium");
     Not expressive
                                                            selenium.type("author", "Jian and
               What does the UI look like?
                                                          Vivek");
               What UI element the locator is
                                                            selenium.type("pages", "100");
                associated with?
                                                            selenium.select("category",
     Fragile                                             "label=Technical");
               Look at the message xpath
                                                          selenium.click("//input[@value='Create']"
     Record and Play                                     );
               Need to cover all testing scenarios         selenium.waitForPageToLoad("30000");
               How about data dependency?
     Refactor                                                //Assert the message count
               Seems to be difficult.                        Assert.assertEquals(1,
                                                          selenium.getXpathCount(“/html/body/div[4]
     Reusable                                            /div[1]"));
               Less likely

     Dynamic factors on the web
               Dynamic data such as data grid and list of options
                and Javascript events
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium’s solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin(Trump)

    Projects

    0.7.0 Feature Preview

    Resources
What Tellurium looks like?




ui.Form(uid: "CreateForm", clocator: [tag: "form", method: "post",
                                        action: "/BookApp/book/save"]){
      Container(uid: "CreateTable", clocator: [tag: "table"]){
          InputBox(uid: "TitleInput", clocator: [tag: "input", type: "text", name: "title",
               id: "title"])
          InputBox(uid: "Author", clocator: [tag: "input", type: "text", name: "author",
                         id: "author"])
          InputBox(uid: "PagesInput", clocator: [tag: "input", type: "text", name: "pages",
               id: "pages"])
          Selector(uid: "CategoryInput", clocator: [tag: "select", id: "category", name:
              "category"])

     }
     SubmitButton(uid: "CreateButton", clocator: [tag: "input", type: "submit",
                         value:"Create", class: "save"])
}

ui.Container(uid: "ShowBook", clocator: [:]){
    Div(uid: "Message", clocator: [tag: "div", class: "message"])
}
Methods defined for UI modules


    public void createBook(String author, String pages, String title) {
        keyType "CreateForm.CreateTable.Author", author
        keyType "CreateForm.CreateTable.PagesInput", pages
        keyType "CreateForm.CreateTable.TitleInput", title
        selectByLabel "CreateForm.CreateTable.CategoryInput", category
        click   "CreateForm.CreateButton"
        waitForPageToLoad 30000
}

public String getMessage(){
      getText "ShowBook.Message"
}
Tellurium Create Book Demo
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin(Trump)

    Projects

    0.7.0 Feature Preview

    Resources
How challenges are addressed in
                Tellurium
   No longer “record and play” style, but UI module oriented
        defining nested UI objects and methods as a UI module class,
         write your own test cases based on the UI module class.
   Decoupling
        UI and tests are separated.
        UI is defined in a Groovy UI module class and test cases in
         Java/Groovy/DSL script.
   Robust
        Composite locator (UI element attributes) is used to define UI
         and the actual xpath will be generated at runtime, i.e., different
         attributes -> different runtime xpath. UI module internal changes
         are addressed.
        Group locating is used to remove the dependency of the UI
         objects from external UI elements, i.e., external UI changes will
         not affect the current UI module for most cases.
   Easy to refactor
        Refactor the individual UI module class
How challenges are addressed in
                 Tellurium

    Reusable
      
          UI module class could be re-used for the same
          application
      
          Tellurium widgets can be re-used for different
          applications.

    Expressive
      
          UI module, Groovy syntax and DSL for actions and
          tests.

    Dynamic factors on Web
      
          UI templates for data grid and dynamic data lists
      
          “respond” attribute in UI object for JavaScript events
How challenges are addressed in Tellurium

    Easy to use
          Tellurium provides a configuration file for you to
           wire in your own new UI objects/widgets and
           customize the framework
          Test can be written in Java/Groovy/DSL Script
          Support JUnit 4 and TestNG
          Reference projects are provided to guide users
           on how to use Tellurium
          Supports ant and Maven build
    Data Driven Testing
Tellurium Validation Demo
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin(Trump)

    Projects

    0.7.0 Feature Preview

    Resources
Why Tellurium is A NEW
              Approach?
   Tellurium comes with a set of new concepts that
    make Tellurium a different and new approach for
    Web Testing
         UI Object
         UI Module
         UID
         Composite Locator
         Group Locating
         UI Template
         Widgets
         DslContext
New Concepts: UI Object


    UI Object includes
          uid: identifier.
          namespace: XHTML/XForm
          locator: the locator of the UI object, could be
                A base locator (relative xpath)
                A composite locator (object attributes)
          group: flag for group locating.
          respond: JavaScript events the UI object should
           respond to.
   Simple UI Objects: Button, CheckBox, Selector, ...
   Container: List, Table, Frame, ...
New Concepts: UI Module


  UI module is a collection of UI elements you
  group them together

  UI module represents a composite UI object in
  the format of nested basic UI elements.

  UI elements inside the composite UI object
  have relationship to each other, i.e., logically or
  to be on the same subtree on the DOM

  For each UI module, define set of methods to
  act on the UI.
New Concepts: UID

                                 Form: “A”        “A”




        “A.B”    InputBox: “B”          Container: “C”      “A.C”




                                  Selector: “D”         List: “E”      “A.C.E”
                    “A.C.D”



                              “A.C.E[1]”     UrlLink: “1”           InputButton: “n”   “A.C.E[n]”


    Each UI object has a UID and is referenced by cascading UIDs

    Elements in List and Table are referenced by indexes

    UID makes Tellurium less verbose and more expressive
New Concepts: Composite Locator


    Composite Locator (clocator): A set of attributes used to
    define the object and the actual locator will be derived
    automatically at run time. For example,
    SubmitButton(uid: "CreateButton", clocator: [tag: "input", type: "submit", value: "Create", class: "save"])

    which is equal to the following runtime xpath:
    //descendant-or-self::form[@method="post" and @action="/BooksApp/book/save"]/descendant-or-
     self::input[@type="submit" and @value="Create" and @class="save"]

    The class definition is as follows,
    class CompositeLocator {
         String header
         String tag
         String text
         String trailer
         def position
        Map<String, String> attributes = [:]
    }


    Each clocator will generate a run time relative locator and
    it makes Tellurium robust to changes inside UI module.
New Concepts: Group Locating





    Usually XPath only includes one path to the target node, for example,
    “/div/div/form/input”, that is to say, only information along this path is used.

    We can use information in the nested object such as the whole form in Fig
    (B), i.e., “A Form whose children are input (attributes), selector
    (attributes), and input(attributes)”

    The composite object has a reference point and once the reference point is
    determined, the other UI elements can be located by their relations to the
    reference point.
New Concepts: UI Template


    UI template can be used for
           Unknown number of UI elements, but the types are
            known
           Many and similar UI elements

    Tellurium List and Table objects use UI templates to
    define the UI elements they include inside.

     ui.Table(uid: "table", clocator: [:]){
        InputBox(uid: "row: 1, column: 1", clocator: [:])
        Selector(uid: "row: *, column: 2", clocator: [:])
        UrlLink(uid: "row: 3, column: *", colocator: [:])
        TextBox(uid: "all", clocator: [:])
     }
New Concepts: Widgets

 Tellurium provides 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.
     
         Reusable
     
         Use name space to avoid name collision
     
         Compiled as a jar file
     
         Load from Tellurium configuration file
Tellurium provides an onWidget method


     
         onWidget(String uid, String method, Object[] args)
Example: JtvTabContainer DOJO widget
ui.Container(uid: “productTab", clocator: [tag: “div”], id:
“*jtv_widget_JtvTabContainer"){
            ......
  DOJO_JtvTabContainer(uid: “TabContainer", clocator: [:], tabs[“Tab 1”, “Tab
2”, “Tab 3”])
}
onWidget “ProductTab.TabContainer", method, parameters
New Concepts: DslContext

  The DSL context is the heart of the Tellurium and
all UI modules must extend the DslContext class

  Defines DSL expression, for instance, “click id”

  DSL context includes
    
        UI object definitions
    
        event actions
    
        data access
    
        Test support

  DslContext is extended to support Data Driven Testing,
which includes input file layout, test definition, and testing
flow.
Tellurium BookList Demo
Do you need to know Groovy ?


    Groovy is a dynamic language for Java
         
             Compatible with Java syntax
         
             Object oriented and expressive
         
             MetaClass for meta programming
         
             Gstring: “label=${target}”
         
             Closures and Optional types

    Tellurium Core is implemented in Groovy and your UI module class
    must be a Groovy class.

    Test cases can be written in Java, Groovy, or pure DSL scripts.

    You do not really need to know Groovy when use Tellurium
         
             UI definition is descriptive using DSL
         
             Methods for UI module can be written in Java syntax
         
             But using Groovy features will make your code more
             concise

    Groovy IDE support (Eclipse, Netbeans, IntelliJ)
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Tellurium UI Model Plugin (Trump)

    Architecture

    Projects

    0.7.0 Feature Preview

    Resources
Tellurium Architecture
Tellurium Architecture

    Test scripts
        
             UI Modules (UI definition)
                • Extend DslContext
                • Consist of nested UI objects
                     – Simple Objects: Button, CheckBox, Selector, ...
                     – Container: List, Table, Frame, ...
                     – Widgets: Tellurium widget extension
        
             Test Cases
               •    Tellurium Groovy Test Case
               •    Tellurium JUnit Test Case (JUnit 4 annotations)
               •    Tellurium TestNG Test Case (TestNG annotations)
               •    Pure DSL Script

    Object-Locator Mapping
        
            XPath
        
            JQuery selector
Tellurium Architecture (Cont'd)

    Event Handler
      
           Default events: mouseOver, focus, blur, ...
      
           UI Object's respond attribute
InputBox(uid: "searchbox", clocator: [title: "Google Search"], respond: ["click",
"focus", "mouseOver", "mouseOut", "blur"])


    Data Accessor
      
           Data/Attributes
      
           Status/Availability

    Dispatcher

    Engine
      
           Modified Selenium Core
      
           Jquery Selector support
      
           Locator caching
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin (Trump)

    Projects

    0.7.0 Feature Preview

    Resources
Tellurium UI Model Plugin (TrUMP)


                     TrUMP IDE is a Firefox
                      plugin to automatically
                      create UI modules for
                      users
                     Download TrUMP xpi file
                      from Tellurium project
                      site to install it
                     Different xpi files for
                      Firefox 3 and Firefox 2.
                     They are the same
                      except the way to show
                      the view is different
                     Logging and preference
                      support
TrUMP: How it works

                            Array
                                                UI Module
Web page
              User Clicks

                  1                                             Validate
                             Generate
                               2
                                                            Validator
                                    Customize
                                            3          Validate
           Internal Tree
TrUMP: Recording




   Click on any element you want to choose
   Click one more time to unselect
   Click on the selected element and TrUMP will show you where it
    is on the web
TrUMP: Generate




   The “Generate” button will generate an internal tree first
   Then TrUMP generates the default UI module
        Selected attributes from a White list
        Event handlers are converted to the respond attribute
        Group option is off by default
TrUMP: Customize




   Group option is available to check
   Optional attributes are available to select
        Position, header, and may others
TrUMP: How to Customize




   You can change UIDs and UI types
   Select or remove attributes
   Turn on group option
   TrUMP automatically validates the UI module. Avoid
    attributes that may change such as position and header.
   Red x mark.
TrUMP: Export UI Module

package tellurium.ui
import org.tellurium.dsl.DslContext
/**
                                                           Export UI module to a groovy file
 * This UI module file is automatically generated by
TrUMP 0.1.0.
                                                            with everything setting up for you
 *
*/
                                                           The plugin only generates the
class NewUiModule extends DslContext{                       UI modules, not the test itself,
        public void defineUi() {                            which is different from
                ui.Container(uid: "Tellurium",
clocator: [tag: "body", class: "t2"]){                      Selenium IDE. You need to
                        Form(uid: "Form", clocator:
[tag: "form", method: "get", action: "list"], group:        define methods for the UI
"true"){
                                 Selector(uid:
"DownloadType", clocator: [tag: "select", name:
                                                            modules.
"can", id: "can"])
                                 InputBox(uid:
                                                           Create JUnit or TestNG Java test
"SearchBox", clocator: [tag: "input", type: "text",
name: "q", id: "q"])
                                                            cases based on the UI module
                                 SubmitButton(uid:
"Search", clocator: [tag: "input", type: "submit",
value: "Search"])
                        }
                        Container(uid: "Title",
clocator: [tag: "table", id: "mt"]){
                                 UrlLink(uid:
"Issues", clocator: [tag: "a", text: "Issues"],
respond: ["click"])
                                 UrlLink(uid: "Wiki",
clocator: [tag: "a", text: "Wiki"], respond:
["click"])
                                 UrlLink(uid:
"Downloads", clocator: [tag: "a", text: "Downloads"],
respond: ["click"])
                        }
                    }
        }
        //Add your methods here
}
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin (Trump)

    Projects

    0.7.0 Feature Preview

    Resources
Tellurium Projects

                                           Tellurium Engine: Similar to
                                            Selenium Core and will be Tellurium
      JUnit             TestNG              test driving engine. More efficient
Reference Project   Reference Project       and supports nested UI object.
                                           Tellurium Core: UI objects, locator
                                            mapping, and test support.
              Tellurium Widget             Tellurium widget: DOJO/ExtJS
                                            widget extension
                                           Tellurium Reference Projects: JUnit
 Trump        Tellurium Core
               Tellurium Core
                                            4 and TestNG projects to
                                            demonstrate how to create real
                                            world Tellurium test cases using
              Tellurium Engine              Tellurium project web site as a
                                            reference.
                                           Trump: Firefox Plugin to
                                            automatically generate UI modules
How to use Tellurium?
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin (Trump)

    Projects

    0.7.0 Feature Preview

    Resources
0.7.0 Feature Preview


    Macro Command

    I18N support

    Runtime diagnosis
       
           diagnose(uid)

    More flexible UI
    templates (UID
    Description Language)

    Build-in trace on
    execution time
       –   useTrace(boolean)
0.7.0 Feature Preview (Cont'd)





    UI module caching

    New API based on jQuery selector

    Group locating based on partial information

    Integration with Finesse
Outline


    Overview

    Problems in Selenium

    Tellurium in Action

    Tellurium's solution

    Tellurium concepts

    Architecture

    Tellurium UI Model Plugin (Trump)

    Projects

    0.7.0 Feature Preview

    Resources
Resources


    Tellurium Project website:
    http://code.google.com/p/aost/

    Tellurium User Group:
    http://groups.google.com/group/tellurium-users

    Trump: https://addons.mozilla.org/en-US/firefox/addon/11035

    Tellurium on Twitter: http://twitter.com/TelluriumTest

    Tellurium IRC channel at freenode.net: #tellurium
Q&A

Contenu connexe

Tendances

Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectKnoldus Inc.
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Mehdi Khalili
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instrumentsArtem Nagornyi
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using JavaF K
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics TutorialClever Moe
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersHaitham Refaat
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Edureka!
 
Introduction to Selenium
Introduction to SeleniumIntroduction to Selenium
Introduction to Seleniumrohitnayak
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyOren Farhi
 
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxMikalai Alimenkou
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Alan Richardson
 
Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch  Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch Haitham Refaat
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAlan Richardson
 

Tendances (20)

Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium Overview
Selenium OverviewSelenium Overview
Selenium Overview
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
 
Introduction to Selenium
Introduction to SeleniumIntroduction to Selenium
Introduction to Selenium
 
Basic Selenium Training
Basic Selenium TrainingBasic Selenium Training
Basic Selenium Training
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxDSL, Page Object and WebDriver – the path to reliable functional tests.pptx
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
 
Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch  Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
 

Similaire à Tellurium At Rich Web Experience2009

Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui TestJohn.Jian.Fang
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaAgile Testing Alliance
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaEr. Sndp Srda
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answerskavinilavuG
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsQuontra Solutions
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui testseleksdev
 
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Yuriy Gerasimov
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Yuriy Gerasimov
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignJames Phillips
 
Best Selenium Online Training
Best Selenium Online TrainingBest Selenium Online Training
Best Selenium Online TrainingSamatha Kamuni
 
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdfTop 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdfAnanthReddy38
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfAnuragMourya8
 
Latest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdfLatest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdfVarsha Rajput
 
Selenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver TutorialSelenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver TutorialAlan Richardson
 

Similaire à Tellurium At Rich Web Experience2009 (20)

Manageable Robust Automated Ui Test
Manageable Robust Automated Ui TestManageable Robust Automated Ui Test
Manageable Robust Automated Ui Test
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answers
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
 
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
 
Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011Automated ui testing with selenium. drupal con london 2011
Automated ui testing with selenium. drupal con london 2011
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
Selenium
SeleniumSelenium
Selenium
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class Design
 
Best Selenium Online Training
Best Selenium Online TrainingBest Selenium Online Training
Best Selenium Online Training
 
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdfTop 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
 
Latest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdfLatest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdf
 
Selenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver TutorialSelenium Clinic Eurostar 2012 WebDriver Tutorial
Selenium Clinic Eurostar 2012 WebDriver Tutorial
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Tellurium At Rich Web Experience2009

  • 1. Tellurium Automated Web Testing Framework Jian Fang (John.Jian.Fang@gmail.com) Vivek Mongolu (vivekmongolu@gmail.com)
  • 2. Who are these guys?  Jian Fang  Senior Software engineer @ Jewelry Television  Enterprise Applications focusing on the server side  Tellurium Project Lead  Vivek Mongolu  Software engineer @ Jewelry Television  Enterprise Applications focusing on the server side and client side  Tellurium Project Member
  • 3. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium’s solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin(Trump)  Projects  0.7.0 Feature Preview  Resources
  • 4. What is Tellurium?  Tellurium is a UI module based web testing framework built on top of Selenium (currently building our own testing engine).  Open source. http://code.google.com/p/aost/  Tellurium is implemented in Groovy and Java  Tellurium includes a set of Domain Specific Languages (DSLs) to define UI, actions, and tests  UI is defined in Groovy class and tests can be written in  Java (JUnit 4 or TestNG)  Groovy  Pure DSL script
  • 5. Tellurium History  2007-06-01, first prototype  2008-01-01, second prototype  2008-07-12, release 0.3.0  2008-08-13, release 0.4.0  2008-12-03, release 0.5.0  2009-06-18, release 0.6.0  2010-02-15, release 0.7.0 (projected)
  • 6. Tellurium Main Features  UI module for structured test code and re-usability  Composite Locator to use a set of attributes to describe a UI element  Group locating to exploit information inside a collection of UI components  UI templates for dynamic web content  JQuery selector support to improve test speed in IE  Data driven testing support  Selenium Grid support  JUnit and TestNG support  Maven support
  • 7. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium’s solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin(Trump)  Projects  0.7.0 Feature Preview  Resources
  • 8. Selenium  Selenium is a suite of tools to automate web app testing across many platforms.  Selenium Core: DHTML test execution framework  Selenium IDE: Firefox extension – record and playback  Selenium Remote Control  Server: launches/kills browser, HTTP Proxy  Client libraries  Selenium Grid  Run Selenium tests in parallel
  • 9. 1. The client/driver reaches out to the selenium-server. 2. Selenium-Server launches a browser with a URL that will load Selenium core web page. 3. Selenium-Core gets the first instruction from the client/driver (via the HTTP Proxy built into the Selenium RC Server). 4. Selenim-Core acts on that first instruction, typlically opening a page of the AUT. 5. Web server is asked for that page, and it renders in the frame/window resered for it. http://seleniumhq.org/documentation/remote-control/how-it-works.html
  • 10. What’s wrong with Selenium  Simple BookStore App – Create Book  The above UI includes Create Book module with three text boxes, one select box and one button  Use Selenium IDE and it generates the following Selenium test case Groovy Recipes: Greasing the Wheels of Java by Scott Davis
  • 11. package com.selenium.bookapp.test; public class SeleniumCreateBookTestCase extends SeleneseTestCase { public void setUp() throws Exception { setUp("http://localhost:8080/BooksApp/", "*chrome"); } public void testNew() throws Exception { selenium.open("book/create"); selenium.type("title", "Tellurium"); selenium.type("author", "Jian and Vivek"); selenium.type("pages", "100"); selenium.select("category", "label=Technical"); selenium.click("//input[@value='Create']"); selenium.waitForPageToLoad("30000"); Assert.assertEquals(1, selenium.getXpathCount("/html/body/div[4]/div[1]")); } }
  • 13. What do you observe?  Verbose  selenium everywhere  Locators everywhere  Coupling  UI locators, actions, and assertions are coupled selenium.open("/book/create"); selenium.type("title", "Tellurium");  Not expressive selenium.type("author", "Jian and  What does the UI look like? Vivek");  What UI element the locator is selenium.type("pages", "100"); associated with? selenium.select("category",  Fragile "label=Technical");  Look at the message xpath selenium.click("//input[@value='Create']"  Record and Play );  Need to cover all testing scenarios selenium.waitForPageToLoad("30000");  How about data dependency?  Refactor //Assert the message count  Seems to be difficult. Assert.assertEquals(1, selenium.getXpathCount(“/html/body/div[4]  Reusable /div[1]"));  Less likely  Dynamic factors on the web  Dynamic data such as data grid and list of options and Javascript events
  • 14. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium’s solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin(Trump)  Projects  0.7.0 Feature Preview  Resources
  • 15. What Tellurium looks like? ui.Form(uid: "CreateForm", clocator: [tag: "form", method: "post", action: "/BookApp/book/save"]){ Container(uid: "CreateTable", clocator: [tag: "table"]){ InputBox(uid: "TitleInput", clocator: [tag: "input", type: "text", name: "title", id: "title"]) InputBox(uid: "Author", clocator: [tag: "input", type: "text", name: "author", id: "author"]) InputBox(uid: "PagesInput", clocator: [tag: "input", type: "text", name: "pages", id: "pages"]) Selector(uid: "CategoryInput", clocator: [tag: "select", id: "category", name: "category"]) } SubmitButton(uid: "CreateButton", clocator: [tag: "input", type: "submit", value:"Create", class: "save"]) } ui.Container(uid: "ShowBook", clocator: [:]){ Div(uid: "Message", clocator: [tag: "div", class: "message"]) }
  • 16. Methods defined for UI modules public void createBook(String author, String pages, String title) { keyType "CreateForm.CreateTable.Author", author keyType "CreateForm.CreateTable.PagesInput", pages keyType "CreateForm.CreateTable.TitleInput", title selectByLabel "CreateForm.CreateTable.CategoryInput", category click "CreateForm.CreateButton" waitForPageToLoad 30000 } public String getMessage(){ getText "ShowBook.Message" }
  • 18. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin(Trump)  Projects  0.7.0 Feature Preview  Resources
  • 19. How challenges are addressed in Tellurium  No longer “record and play” style, but UI module oriented  defining nested UI objects and methods as a UI module class, write your own test cases based on the UI module class.  Decoupling  UI and tests are separated.  UI is defined in a Groovy UI module class and test cases in Java/Groovy/DSL script.  Robust  Composite locator (UI element attributes) is used to define UI and the actual xpath will be generated at runtime, i.e., different attributes -> different runtime xpath. UI module internal changes are addressed.  Group locating is used to remove the dependency of the UI objects from external UI elements, i.e., external UI changes will not affect the current UI module for most cases.  Easy to refactor  Refactor the individual UI module class
  • 20. How challenges are addressed in Tellurium  Reusable  UI module class could be re-used for the same application  Tellurium widgets can be re-used for different applications.  Expressive  UI module, Groovy syntax and DSL for actions and tests.  Dynamic factors on Web  UI templates for data grid and dynamic data lists  “respond” attribute in UI object for JavaScript events
  • 21. How challenges are addressed in Tellurium  Easy to use  Tellurium provides a configuration file for you to wire in your own new UI objects/widgets and customize the framework  Test can be written in Java/Groovy/DSL Script  Support JUnit 4 and TestNG  Reference projects are provided to guide users on how to use Tellurium  Supports ant and Maven build  Data Driven Testing
  • 23. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin(Trump)  Projects  0.7.0 Feature Preview  Resources
  • 24. Why Tellurium is A NEW Approach?  Tellurium comes with a set of new concepts that make Tellurium a different and new approach for Web Testing  UI Object  UI Module  UID  Composite Locator  Group Locating  UI Template  Widgets  DslContext
  • 25. New Concepts: UI Object  UI Object includes  uid: identifier.  namespace: XHTML/XForm  locator: the locator of the UI object, could be  A base locator (relative xpath)  A composite locator (object attributes)  group: flag for group locating.  respond: JavaScript events the UI object should respond to.  Simple UI Objects: Button, CheckBox, Selector, ...  Container: List, Table, Frame, ...
  • 26. New Concepts: UI Module  UI module is a collection of UI elements you group them together  UI module represents a composite UI object in the format of nested basic UI elements.  UI elements inside the composite UI object have relationship to each other, i.e., logically or to be on the same subtree on the DOM  For each UI module, define set of methods to act on the UI.
  • 27. New Concepts: UID Form: “A” “A” “A.B” InputBox: “B” Container: “C” “A.C” Selector: “D” List: “E” “A.C.E” “A.C.D” “A.C.E[1]” UrlLink: “1” InputButton: “n” “A.C.E[n]”  Each UI object has a UID and is referenced by cascading UIDs  Elements in List and Table are referenced by indexes  UID makes Tellurium less verbose and more expressive
  • 28. New Concepts: Composite Locator  Composite Locator (clocator): A set of attributes used to define the object and the actual locator will be derived automatically at run time. For example, SubmitButton(uid: "CreateButton", clocator: [tag: "input", type: "submit", value: "Create", class: "save"]) which is equal to the following runtime xpath: //descendant-or-self::form[@method="post" and @action="/BooksApp/book/save"]/descendant-or- self::input[@type="submit" and @value="Create" and @class="save"]  The class definition is as follows, class CompositeLocator { String header String tag String text String trailer def position Map<String, String> attributes = [:] }  Each clocator will generate a run time relative locator and it makes Tellurium robust to changes inside UI module.
  • 29. New Concepts: Group Locating  Usually XPath only includes one path to the target node, for example, “/div/div/form/input”, that is to say, only information along this path is used.  We can use information in the nested object such as the whole form in Fig (B), i.e., “A Form whose children are input (attributes), selector (attributes), and input(attributes)”  The composite object has a reference point and once the reference point is determined, the other UI elements can be located by their relations to the reference point.
  • 30. New Concepts: UI Template  UI template can be used for  Unknown number of UI elements, but the types are known  Many and similar UI elements  Tellurium List and Table objects use UI templates to define the UI elements they include inside. ui.Table(uid: "table", clocator: [:]){ InputBox(uid: "row: 1, column: 1", clocator: [:]) Selector(uid: "row: *, column: 2", clocator: [:]) UrlLink(uid: "row: 3, column: *", colocator: [:]) TextBox(uid: "all", clocator: [:]) }
  • 31. New Concepts: Widgets  Tellurium provides 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.  Reusable  Use name space to avoid name collision  Compiled as a jar file  Load from Tellurium configuration file Tellurium provides an onWidget method   onWidget(String uid, String method, Object[] args) Example: JtvTabContainer DOJO widget ui.Container(uid: “productTab", clocator: [tag: “div”], id: “*jtv_widget_JtvTabContainer"){ ...... DOJO_JtvTabContainer(uid: “TabContainer", clocator: [:], tabs[“Tab 1”, “Tab 2”, “Tab 3”]) } onWidget “ProductTab.TabContainer", method, parameters
  • 32. New Concepts: DslContext  The DSL context is the heart of the Tellurium and all UI modules must extend the DslContext class  Defines DSL expression, for instance, “click id”  DSL context includes  UI object definitions  event actions  data access  Test support  DslContext is extended to support Data Driven Testing, which includes input file layout, test definition, and testing flow.
  • 34. Do you need to know Groovy ?  Groovy is a dynamic language for Java  Compatible with Java syntax  Object oriented and expressive  MetaClass for meta programming  Gstring: “label=${target}”  Closures and Optional types  Tellurium Core is implemented in Groovy and your UI module class must be a Groovy class.  Test cases can be written in Java, Groovy, or pure DSL scripts.  You do not really need to know Groovy when use Tellurium  UI definition is descriptive using DSL  Methods for UI module can be written in Java syntax  But using Groovy features will make your code more concise  Groovy IDE support (Eclipse, Netbeans, IntelliJ)
  • 35. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Tellurium UI Model Plugin (Trump)  Architecture  Projects  0.7.0 Feature Preview  Resources
  • 37. Tellurium Architecture  Test scripts  UI Modules (UI definition) • Extend DslContext • Consist of nested UI objects – Simple Objects: Button, CheckBox, Selector, ... – Container: List, Table, Frame, ... – Widgets: Tellurium widget extension  Test Cases • Tellurium Groovy Test Case • Tellurium JUnit Test Case (JUnit 4 annotations) • Tellurium TestNG Test Case (TestNG annotations) • Pure DSL Script  Object-Locator Mapping  XPath  JQuery selector
  • 38. Tellurium Architecture (Cont'd)  Event Handler  Default events: mouseOver, focus, blur, ...  UI Object's respond attribute InputBox(uid: "searchbox", clocator: [title: "Google Search"], respond: ["click", "focus", "mouseOver", "mouseOut", "blur"])  Data Accessor  Data/Attributes  Status/Availability  Dispatcher  Engine  Modified Selenium Core  Jquery Selector support  Locator caching
  • 39. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin (Trump)  Projects  0.7.0 Feature Preview  Resources
  • 40. Tellurium UI Model Plugin (TrUMP)  TrUMP IDE is a Firefox plugin to automatically create UI modules for users  Download TrUMP xpi file from Tellurium project site to install it  Different xpi files for Firefox 3 and Firefox 2.  They are the same except the way to show the view is different  Logging and preference support
  • 41. TrUMP: How it works Array UI Module Web page User Clicks 1 Validate Generate 2 Validator Customize 3 Validate Internal Tree
  • 42. TrUMP: Recording  Click on any element you want to choose  Click one more time to unselect  Click on the selected element and TrUMP will show you where it is on the web
  • 43. TrUMP: Generate  The “Generate” button will generate an internal tree first  Then TrUMP generates the default UI module  Selected attributes from a White list  Event handlers are converted to the respond attribute  Group option is off by default
  • 44. TrUMP: Customize  Group option is available to check  Optional attributes are available to select  Position, header, and may others
  • 45. TrUMP: How to Customize  You can change UIDs and UI types  Select or remove attributes  Turn on group option  TrUMP automatically validates the UI module. Avoid attributes that may change such as position and header.  Red x mark.
  • 46. TrUMP: Export UI Module package tellurium.ui import org.tellurium.dsl.DslContext /**  Export UI module to a groovy file * This UI module file is automatically generated by TrUMP 0.1.0. with everything setting up for you * */  The plugin only generates the class NewUiModule extends DslContext{ UI modules, not the test itself, public void defineUi() { which is different from ui.Container(uid: "Tellurium", clocator: [tag: "body", class: "t2"]){ Selenium IDE. You need to Form(uid: "Form", clocator: [tag: "form", method: "get", action: "list"], group: define methods for the UI "true"){ Selector(uid: "DownloadType", clocator: [tag: "select", name: modules. "can", id: "can"]) InputBox(uid:  Create JUnit or TestNG Java test "SearchBox", clocator: [tag: "input", type: "text", name: "q", id: "q"]) cases based on the UI module SubmitButton(uid: "Search", clocator: [tag: "input", type: "submit", value: "Search"]) } Container(uid: "Title", clocator: [tag: "table", id: "mt"]){ UrlLink(uid: "Issues", clocator: [tag: "a", text: "Issues"], respond: ["click"]) UrlLink(uid: "Wiki", clocator: [tag: "a", text: "Wiki"], respond: ["click"]) UrlLink(uid: "Downloads", clocator: [tag: "a", text: "Downloads"], respond: ["click"]) } } } //Add your methods here }
  • 47. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin (Trump)  Projects  0.7.0 Feature Preview  Resources
  • 48. Tellurium Projects  Tellurium Engine: Similar to Selenium Core and will be Tellurium JUnit TestNG test driving engine. More efficient Reference Project Reference Project and supports nested UI object.  Tellurium Core: UI objects, locator mapping, and test support. Tellurium Widget  Tellurium widget: DOJO/ExtJS widget extension  Tellurium Reference Projects: JUnit Trump Tellurium Core Tellurium Core 4 and TestNG projects to demonstrate how to create real world Tellurium test cases using Tellurium Engine Tellurium project web site as a reference.  Trump: Firefox Plugin to automatically generate UI modules
  • 49. How to use Tellurium?
  • 50. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin (Trump)  Projects  0.7.0 Feature Preview  Resources
  • 51. 0.7.0 Feature Preview  Macro Command  I18N support  Runtime diagnosis  diagnose(uid)  More flexible UI templates (UID Description Language)  Build-in trace on execution time – useTrace(boolean)
  • 52. 0.7.0 Feature Preview (Cont'd)  UI module caching  New API based on jQuery selector  Group locating based on partial information  Integration with Finesse
  • 53. Outline  Overview  Problems in Selenium  Tellurium in Action  Tellurium's solution  Tellurium concepts  Architecture  Tellurium UI Model Plugin (Trump)  Projects  0.7.0 Feature Preview  Resources
  • 54. Resources  Tellurium Project website: http://code.google.com/p/aost/  Tellurium User Group: http://groups.google.com/group/tellurium-users  Trump: https://addons.mozilla.org/en-US/firefox/addon/11035  Tellurium on Twitter: http://twitter.com/TelluriumTest  Tellurium IRC channel at freenode.net: #tellurium
  • 55. Q&A