learn leanft at stag leanft at stag - presentation... · what is leanft? 5 a lightweight, yet...

22
Learn LeanFT Presenter: Kate Droukman au.linkedin.com/in/katedroukman 21 April 2016 @ Software Test Automation Group Meetup

Upload: others

Post on 22-Mar-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Learn LeanFT

Presenter: Kate Droukman

au.linkedin.com/in/katedroukman

21 April 2016

@ Software Test Automation Group Meetup

Agenda

2

Agenda

3

Topic

LeanFT Quick Intro

LeanFT IDE Plugins & SDK

Hands-On – JUnit/OIC, Application Model, Reporter

LeanFT & BDD

Q&A

Quick Intro

4

What is LeanFT?

5

A lightweight, yet powerful, Functional Test Automation solution

Built specifically for Continuous Integration and Continuous Testing

Targeted to technical automation engineers and dev-testers in Agile Teams

Integrated into standard IDEs

Creating tests in Modern

Programming Languages

Rich AUT Technology

Support

Complementary with UFT

Natural Integration

with Dev & QA ecosystems

Supported Technologies

WebSAP

Mobile

.NETJava

StdWin

Based on UFT technology support

Insight technology (Image-Based)

Extensibility (future)

LeanFT & the Dev-QA Ecosystem

HP ALM

LeanFT Main Core Features

SDK

A powerful code library used to interact with the AUT

Provided in 3 flavors: .NET (C#), Java, JavaScript *

Comprehensive, user-friendly & fully-documented

Object Identification Center

One stop shop for any object identification task

Object inspection, customizing identifications & code generation accelerator

Application Models

A rich graphic tool (in the IDE)

Abstracting application objects

Separating the test logic from the object identification

Provided by the LeanFT IDE plugin

Run Report

A rich html run report

Generated automatically

Enables easy root-cause analysis

LeanFT – IDE Plugins & SDK

9

LeanFT – IDE Integration

10

LeanFT integrates with:

Visual Studio (2012, 2013 & 2015)

Eclipse (Kepler, Luna, Mars)

More in the future (e.g.: IntelliJ)

The main LeanFT-IDE integration components:

LeanFT SDK

LeanFT IDE plugin

Existing IDE capabilities can be leveraged

E.g.: Code Completion / Debugging

Tests are authored using modern programming languages

C# / Java / JavaScript

LeanFT – IDE Plugin

11

Main capabilities provided:

Project templates for common TDD frameworks:

NUnit and MSTest (for VS)

JUnit (for Eclipse, and in the future: for IntelliJ)

More in the future (e.g.: TestNG for Eclipse / IntelliJ)

Tools:

The Object Identification Center (“OIC”)

Application Models

LeanFT – SDK

12

Provided in 3 flavors:

A comprehensive, rich, user-friendly and fully documented automation code library

LeanFT – SDK (2)

13

The SDK is fully typed, E.g.:

Technology Object Type Test Object Type Description Class

Web .NET: HP.LFT.SDK.Web.ILink

Java: com.hp.lft.sdk.web.Link

.NET: HP.LFT.SDK.Web.LinkDescription

Java: com.hp.lft.sdk.web.LinkDescription

Mobile .NET: HP.LFT.SDK.Mobile.IToggle

Java: com.hp.lft.sdk.mobile.Toggle

.NET: HP.LFT.SDK.Mobile.ToggleDescription

Java: com.hp.lft.sdk.mobile.ToggleDescription

Java .NET: HP.LFT.SDK.Java.ICalendar

Java: com.hp.lft.sdk.java.Calendar

.NET: HP.LFT.SDK.Java.CalendarDescription

Java: com.hp.lft.sdk.java.CalendarDescription

WPF .NET: HP.LFT.SDK.WPF.IMenu

Java: com.hp.lft.sdk.wpf.Menu

.NET: HP.LFT.SDK.WPF.MenuDescription

Java: com.hp.lft.sdk.wpf.MenuDescription

LeanFT – SDK (3)

Error Handling – LeanFT SDK Exceptions:

ReplayObjectNotFoundException - when the object cannot be located

ReplayObjectNotUniqueException - when there is more than one object matching the given description

Child Objects:

Getting a collection of child test objects which match a given description:

Hands-On Demo

15

LeanFT & BDD

16

BDD & LeanFT

Q: Which BDD frameworks are supported by LeanFT?

A: All of them!

[When(@"John wants to buy (.*) tickets from '(.*)' to '(.*)'")]public void WhenJohnWantsToBuyTicketsFromTo(int numberOfTickets, string from, string to){

// Setting source locationbrowser.Describe<IListBox>(new ListBoxDescription { TagName = @"SELECT",

Name = @"fromPort"}).Select(from);

// Setting destination locationbrowser.Describe<IListBox>(new ListBoxDescription {TagName = @"SELECT", Name = @"toPort"}).Select(to);

// Setting the number of ticketsbrowser.Describe<IListBox>(new ListBoxDescription { TagName = @"SELECT",

Name = @"passCount“ }).Select(numberOfTickets.ToString());

// Clicking to continue the flight reservationbrowser.Describe<IImage>(new ImageDescription { Name = "findFlights",

Type = HP.LFT.SDK.Web.ImageType.Button, TagName = @"INPUT“ }).Click();}

BDD & LeanFT – Implementation details

Recommendation:

Create your projects based on the LeanFT template project

Adjust as needed to fit the BDD framework you are using

If you do not use the template, do the following:

1. Reference the LeanFT SDK

2. Make sure LeanFT is initialized before executing the scenarios.You can do this by using the BeforeScenario method

3. Implement all methods using LeanFT automation

4. Make sure the LeanFT Report is generated at the end of the run

For more details, see the LeanFT Help Center:http://leanft-help.saas.hpe.com/en/latest/HelpCenter/Content/HowTo/CustomFrameworks.htm

BDD & LeanFT

All LeanFT capabilities and tools, such as OIC and application models, should still be used as in a regular LeanFT project

Recommendation: Install the IDE BDD framework plugin.This helps when editing feature files, running tests, and binding the steps to the implementation methods

Detailed information on how to use LeanFT and Cucumber in C# and Java can be found in the LeanFT help center:http://leanft-help.saas.hpe.com/en/latest/HelpCenter/Content/HowTo/Cucumber.htm

BDD & LeanFT

20

try{

ModifiableSDKConfiguration c

onfig = new ModifiableSDKConfiguration()

;

config.setServerAddress(new

URI("ws://myServerAddress:5095"));

SDK.init(config);

Reporter.init();

//put your test code here.

//Generate the report and cl

eanup the SDK usage.

Reporter.generateReport();

SDK.cleanup();

}

catch(Exception e){

}

public void beforeFeatureScenario(Scenario scenari

o) throws IOException, GeneralLeanFtException, Rep

ortException {

//the following will start a new test node

in the report

Reporter.startTest(scenario.getName());

//other before scenario code

}

public void afterFeatureScenario(Scenario scenario

) throws IOException, GeneralLeanFtException, Repo

rtException {

// The following ends the test node in the

report

Reporter.endTest();

}

Thank you

22