Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

1 A Test Automation Tool For Java Applets Testing of Web Applications TATJA Program Demonstration Conclusions By Matthew Xuereb.
LOGO Tech propulsion Labs Android Webdriver Test automation - Selenium 2 Masud Parvez SQA Architect Tech Propulsion Labs
BY: KYLE ROGAHN COMPUTER SCIENCE SEMINAR UW PLATTEVILLE 4/3/2012 Web Browser Automation - Geb.
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
Automation using Selenium Authored & Presented by : Chinmay Sathe & Amit Prabhu Cybage Software Pvt. Ltd.
UNIT-V The MVC architecture and Struts Framework.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Slide 1 Today you will: think about criteria for judging a website understand that an effective website will match the needs and interests of users use.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
1 Modular Software/ Component Software 2 Modular Software Code developed in modules. Modules can then be linked together to produce finished product/program.
User Extensions, RC and Web Driver Anton Angelov QA Engineer SystemIntegrationTeam Telerik QA Academy Telerik QA Academy.
ExtWebDriver Open Source Project Daniel Koo Latha Nagaraj Bryan Robbins 04/23/2014.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Selenium automated testing in Openbravo ERP Quality Assurance Webinar April 8th, 2010.
Val Kravets, Luis Sanchez, Allen Chung, Phillip Anderson, Leyla Norooz, Brian Ramnarian, Todd Watson.
1 Test Automation For Web-Based Applications Selenium HP Web Test Tool Training Portnov Computer School.
Selenium Web Test Tool Training Using Ruby Language Discover the automating power of Selenium Kavin School Kavin School Presents: Presented by: Kangeyan.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
Edit a Page Detailed Front End To edit any information on your web page, you will have to login to the admin tool to change it.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Testing Web Applications. Plan The presentation covers: Selenium framework Spring MVC Test framework HttpUnit framework.
And the PageObject Design Model.  How Selenium Remote Control works  You launch a server on your test machine.  Your tests connect to that server via.
Web Automation Testing With Selenium By Rajesh Kanade.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Automated Smoke Testing on the JVM with Geb João SILVA (GS-AIS-EB) 1st Forum 29th of September, 2015 e-Business Section AUTOMATED SMOKE.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Lec 19 Web Driver 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Lecture 19 Selenium Web Driver 11/4/
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
ScriptOnce™ & Best Practices. Agenda 2 Automation that works ScriptOnce –Minimal maintenance –Easy to add devices Robustness –Reliable Scripts - Minimize.
Test Automation Using Selenium Presented by: Shambo Ghosh Ankit Sachan Samapti Sinhamahapatra Akshay Kotawala.
Tata Consultancy Services1 WebDriver Basics Submitted By : Akhil K Gagan Deep Singh Naveenrajha H M Poornachandra Meduri Shubham Utsav Sunil Kumar G Vivek.
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
QA Online Training In QA Click Academy. Selenium is a test automation framework used to test web applications such as browsers. It consists of different.
#SummitNow Load-testing Share Using the Benchmark Framework November 2013 Derek Hulley Michael Suzuki
Sqs.com SQS – the world’s leading specialist in software quality Please copy a slide with a suitable picture from the file „Title Slides_EN.pptx“ (change.
Load Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
Introduction of Selenium Eli Lu 2016/10/13. Outline What is selenium ? Selenium Projects Selenium Sponsors Easy to use Useful Feature & Tools Useful Links.
Selenium HP Web Test Tool Training
The Zen of UI Test Automation
Unit M Programming Web Pages with
Selenium and Selenium on Rails
Selenium HP Web Test Tool Training
How to Test a Complex ERP Application using a Data-Driven Framework
Selenium HP Web Test Tool Training
Software Testing.
Introduction of Selenium Webdriver Using Java
Automating GUI testing with Selenium WebDriver, Java and Eclipse
Selenium WebDriver Web Test Tool Training
Unit M Programming Web Pages with
Testing Your Alfresco Add-ons
CSCE 747 Software Testing and Quality Assurance
Software Quality Assurance
MONASH ENGINEERING MoodleBOT
Haden Jackson-Robbins
Selenium HP Web Test Tool Training
Modern web applications
Web UI testing automation and Selenium
Test Automation For Web-Based Applications
CSCE 747 Software Testing and Quality Assurance
DevOps Meetup | Test Automation | 3/19/2012
An introduction to jQuery
An introduction to jQuery
CSCE 747 Software Testing and Quality Assurance
An introduction to jQuery
Presentation transcript:

Testing Your Alfresco Add-ons Michael Suzuki Software Engineer

Testing Your Alfresco Add-ons Introduction Automation Tools Best Practice Setting Up With Maven Demo

Michael github.com/michaelsuzukisagi

Why Testing Makes Sense It builds Confidence that the systems is behaving as it should. Validates no regression bugs have been introduced Pins the functionality Helps find problems early Detecting difference

Test Types Unit Tests Integration Tests Functional Tests

The Right Balance

Testing Your Alfresco Add-ons Automation Tools

WebDriver An open source browser automation API. Supports different OS, languages and browsers.

WebDriver Code { //Start fire fox WebDriver driver = new FireFoxDriver(); //Navigate to share driver.navigate( }

Locator Strategies Id Name Tag name Class name CSS selector Xpath Link Text Partial Link Text

Locator Strategies In Action { //By Id WebElement username = driver.findElement(By.id(“iusername”)); //By Name WebElement password = driver.findElement(By.name(“password”)); //By Tag Name WebElement btn= driver.findElement(By.tagName(“button”)); //By CSS selector username = driver.findElement(By.cssSelector(“input#iusername”)); //By class name WebElement btn =driver.findElement(By.className(“button”)); //By xpath btn = driver.findElement(By.cssSelector(“//button)); }

Interacting With Elements { //Find Element By Id WebElement element = driver.findElement(By.id(“foo”)); //check if visible element.isDisplayed(); //type in admin element.sendKeys(“admin”); //clear input field element.clear(); //click action element.click(); //get text element.getText(); }

Testing Your Alfresco Add-ons Best Practice

Always Use Page Object Pattern Render Pattern

Page Object “A page object wraps an HTML page, or fragment, with an application-specific API, allowing you to manipulate page elements without digging around in the HTML” Martin Fowler

Login Page Object public class LoginPage { private static By USERNAME_INPUT = By.id(“username"); private static By PASSWORD_INPUT = By.id(“password"); private static By SUBMIT_BUTTON = By.id(“submit"); public LoginPage(WebDriver driver) {} public void login(String username, String password) { // Find By Id WebElement username = driver.findElement(USERNAME_INPUT); username.sendKeys(username); WebElement password = driver.findElement(PASSWORD_INPUT); password.sendKeys(password); driver.findElement(SUBMIT_BUTTON).click(); }

Why You Should Use Page Objects Encourages re-use of the code Makes tests more readable Encapsulates mechanical details of the page Easier to maintain

Render Pattern The logic which determines if a page has rendered, by checking that all the required web elements of the page, are visible before it can be used.

Render Method In Action public LoginPage render(RenderTime timer) { while (true) { timer.start(); try { if(driver.find(USERNAME_INPUT).isDisplayed() && driver.find(PASSWORD_INPUT).isDisplayed() && driver.find(SUBMIT_BUTTON).isDisplayed() { break; } catch (NoSuchElementException nse){} finally { timer.end(); } return this; }

Share PO Project Aims to mimic user interaction on Alfresco Share. A library that is simple, reliable and reusable. The project started in 2012 and is now part of Alfresco core.

WebDrone Project A Selenium WebDriver wrapper with added functionality. Provides additional tools: Selenium grid Image recognition Language support

Things To Avoid WebDriver code in test code Assertions in page objects Thread sleep

Testing Your Alfresco Add-ons Demo

Build Add-ons with Maven mvn install -Pamp-to-war mvn archetype:generate - DarchetypeCatalog= oups/public/archetype-catalog.xml - Dfilter=org.alfresco.maven.archetype: export MAVEN_OPTS="-XX:MaxPermSize=512m -Xmx1024m” Setup Maven options Create project from archetype Run AMP with Maven Run test mvn install –Pfunctional

Thank you

Additional Info Share Page Object WebDrone Demo Selenium WebDriver Alfresco Maven Spring Loaded