Ten Minutes To Tellurium


Published on

The Tellurium Automated Testing Framework (Tellurium) is a UI module-based web automated testing framework built on top of Selenium. Here is a step by step guide to teach you how to create a New Tellurium Test project.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Ten Minutes To Tellurium

  1. 1. 10 Minutes to Tellurium Jian Fang (John.Jian.Fang@gmail.com) Vivek Mongolu (vivekmongolu@gmail.com) Matt Senter (matt.senter@gmail.com) Haroon Rasheed (haroonzone@gmail.com) Quan Bui (Quan.Bui@gmail.com) Mikhail Koryak (koryak@gmail.com)
  2. 2. What is Tellurium? Tellurium is a UI module ● based web testing framework built on top of JUnit TestNG Selenium Reference Project Reference Project Tellurium includes ● Tellurium Widget Domain Specific ● Languages Tellurium Core TrUMP Java object to UI Mapping ● JUnit, TestNG, and Data ● Tellurium Engine Driven Testing support
  3. 3. Tellurium Features UI module-based, separate UI from testing ● code Use UI attributes to define UI ● Dynamically generate runtime locators ● Use Groovy to achieve expressiveness ● Define widgets for reusable components ● Address dynamic web such as data grid and ● Javascript events ui.Container(uid: quot;Googlequot;, clocator: [tag: quot;tablequot;]) { InputBox(uid: quot;Inputquot;, clocator: [tag: quot;inputquot;, title: quot;Google Searchquot;, name: quot;qquot;]) SubmitButton(uid: quot;Searchquot;, clocator: [tag: quot;inputquot;, type: quot;submitquot;, value: quot;Google Searchquot;, name: quot;btnGquot;]) SubmitButton(uid: quot;ImFeelingLuckyquot;, clocator: [tag: quot;inputquot;, value: quot;I'm Feeling Luckyquot;, name: quot;btnIquot;]) }
  4. 4. How to use Tellurium? Use Tellurium jar and configuration file Maven Use Reference Project as Manually create Project Maven Archetype a base TrUMP Create UI modules Groovy Class extends DslContext Create methods for UI modules JUnit/TestNG Create Test Cases In Java, Groovy, or DSL Run Tests
  5. 5. Setup Maven Assume you have Maven 2.0.9 installed ● Add Tellurium Maven Repository to your Maven ● settings.xml <settings>     <profiles>         <profile>             <activation>                 <activeByDefault>true</activeByDefault>             </activation>             <repositories>                  <repository>                       <id>kungfuters-public-snapshots-repo</id>                     <name>Kungfuters.org Public Snapshot Repository</name>                     <releases>                                   <enabled>false</enabled>                     </releases>                             <snapshots>                                 <enabled>true</enabled>                     </snapshots>                             <url>http://kungfuters.org/nexus/content/repositories/snapshots</url>                 </repository>               </repositories>         </profile>     </profiles> </settings>
  6. 6. Create a Tellurium Test Project Tellurium provides two ● archetypes Tellurium-junit-archetype – tellurium-testng-archetype – Use a Tellurium archetype ● to create a new project called “demo” mvn archetype:create -DgroupId=example -DartifactId=demo -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=1.0-SNAPSHOT
  7. 7. Open Project using IntelliJ IDEA Open IntelliJ IDEA and do the following steps ● New Project > Import project from external mode > Select Maven > Select Project directory > Finish Make sure Groovy in project is 1.6.0 ● Compile project ● Run the sample test GoogleSearchTestCase ●
  8. 8. Download and Install 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 Or download it directly ● from Firefox addons
  9. 9. Use TrUMP to Record UI Module Open http://code.google.com/p/aost/downloads/list ● Click on the Download search Module ● Generate UI module ● Customize UI module ●
  10. 10. Create UI module Export the UI module as NewUiModule.groovy ● Add methods ● class NewUiModule extends DslContext { public void defineUi() { ui.Form(uid: quot;TelluriumDownloadquot;, clocator: [tag: quot;formquot;, method: quot;getquot;, action: quot;listquot;], group: quot;truequot;) { Selector(uid: quot;DownloadTypequot;, clocator: [tag: quot;selectquot;, name: quot;canquot;, id: quot;canquot;]) InputBox(uid: quot;Inputquot;, clocator: [tag: quot;inputquot;, type: quot;textquot;, name: quot;qquot;, id: quot;qquot;]) SubmitButton(uid: quot;Searchquot;, clocator: [tag: quot;inputquot;, type: quot;submitquot;, value: quot;Searchquot;]) } } //Add your methods here public void searchDownload(String keyword) { keyType quot;TelluriumDownload.Inputquot;, keyword click quot;TelluriumDownload.Searchquot; waitForPageToLoad 30000 } public String[] getAllDownloadTypes() { return getSelectOptions(quot;TelluriumDownload.DownloadTypequot;) } public void selectDownloadType(String type) { selectByLabel quot;TelluriumDownload.DownloadTypequot;, type } }
  11. 11. Create Tellurium Test Cases public class NewTestCase extends TelluriumJavaTestCase { private static NewUiModule app; @BeforeClass public static void initUi() { app = new NewUiModule(); app.defineUi(); } @Before public void setUpForTest() { connectUrl(quot;http://code.google.com/p/aost/downloads/listquot;); } @Test public void testTelluriumProjectPage() { String[] allTypes = app.getAllDownloadTypes(); assertNotNull(allTypes); assertTrue(allTypes[1].contains(quot;All Downloadsquot;)); app.selectDownloadType(allTypes[1]); app.searchDownload(quot;TrUMPquot;); } }
  12. 12. Questions and Comments ? Post them to Tellurium user group at ● http://groups.google.com/group/tellurium-users Vist Tellurium Project website for any updates ● http://code.google.com/p/aost Tellurium Firefox Plugin is available publicly at ● https://addons.mozilla.org/en-US/firefox/addon/11035