Introducing Selenium Builder – the Future of Test Development

Post on 02-Jul-2015

5.129 views 1 download

Transcript of Introducing Selenium Builder – the Future of Test Development

Se BuilderLet's talk about the future.

@admc @zarkonnen_com

History

● Windmill● GTI● Se Builder 1 release● People care

Now

● Preparing for a 2.0 release● 1 year of development● Refactor● Addition of Selenium 2 support● Moved to github● Apache 2 license● sebuilder.com

Usage

Community

● We need community● We need plugins● We need multiple browsers● We need your help

David Stark

● Originally drafted to fix some bugs in GTI● Rewrote most of it → Se Builder

Se Builder: It does both

● Same UX for Selenium 1/2● Easier start with Selenium 2● Transition path

Selenium 1 Support

● A simple alternative to Selenium IDE

Selenium 1: Recording

Selenium 1: Editing

Selenium 1: Playback

Selenium 1: Save/Load

Selenium 1: Suites

Selenium 1: Extensions

● user_extensions.js● Compatible with Selenium IDE

Selenium 2 Support

● Selenium 1: List of steps● Selenium 2: More flexible API● Too flexible for simple IDE● Want to keep UX similar to Selenium 1

Selenium 2 Steps● Simplify tests back to list of steps● Step types that map onto Sel 1 actions● Less flexible, but better UX● Fine for most purposes?● Might add control flow later

driver.get("http://www.sebuilder.com/");

get http://www.sebuilder.com/

Result: Identical UX

JSON Format● Selenium 1 has Selenese● JSON file for Selenium 2 steps{ "seleniumVersion": "2", "formatVersion": 1, "steps": [

{ "type": "get", "url": "http://www.sebuilder.com/" },{ "type": "verifyTextPresent", "text": "Open Source" },{

"type": "clickElement", "locator": { "type": "link text", "value": "Docs" }

} ]}

Converting● Can automatically convert some scripts● Upgrade path● "What would this look like in Selenium 2?"

open http://www.sebuilder.com/

waitForPageToLoad 60000

assertTitle Se Builder

FirefoxDriver wd = new FirefoxDriver ();wd.manage().timeouts().implicitlyWait( 60, TimeUnit.SECONDS);wd.get("http://www.sebuilder.com/ ");if (!wd.getTitle().equals( "Se Builder")){

wd.close();throw new RuntimeException ("failed");

}wd.close();

Selenium 2 Support● Record● Edit● Play back● Load, save & export

Architecture● Based on HTML/JS/jQuery● Thin XUL wrapper● Mostly browser-agnostic

Window: XUL

Se Builder CodeHTML/JS/jQuery

Architecture

Selenium 2Selenium 1 Converter

Script Editing GUIMenus, etc.

Common data structuresRecording

HTML/JS/jQuery

● Selenium version-agnostic

Kill version-specific code

Selenium 2Selenium 1 Converter

All GUI Code

Common data structures

HTML/JS/jQuery

Rec Rec

Goal: Modularity

● List of n (= 2) supported script types● Extensible list of step types● Extensible list of export formats● Extensible GUI

// TODO

● Se Builder is in Beta● Want more features● Want fewer bugs

Broader Support

● More step types● More export languages and frameworks:

JUnit, TestNG, C#, Ruby, Perl● It's easy

Beautiful exported code

● It's important● Need consistent test behaviour● Exported code used as base for more code● Set a good example● Help establish good practices

Selenium 2 Suites

● Format for storing suites● Based on JSON● Exporting suites to code

Extensibility

● Ecosystem of plugins is key● Custom steps and export formats● Custom widgets● Flash support, etc.● Keep core Se Builder simple

Step Plugins

● Definition of new steps (name, parameters)● Record code● Playback code● Export code● Selenium 2 JSON specifies plugins

GUI Plugins

● HTML/JS/jQuery makes this easy● Define listeners● Define widget attachment points● Good hooks → clean extensions● What hooks do you need?

Other Browsers

● HTML/JS not tied to browser like XUL● Recording is fiddly and browser-specific● Goal: Insulate browser-specific code● Then port to Chrome, etc.● Who wants to give it a try?

Wanted: Contributors

● Try it out and give feedback● Write about it● Fix bugs● Improve quality of exported code● Add a new export language/framework● It's on GitHub: fork it & add new features!

What now?

● Get involved● Let's make some plans● Let's unify and execute

Questions

● You know you do.

Thanks!

@seleniumconf is awesome. ● sebuilder.com● github.com/admc/se-builder● @admc, @zarkonnen_com● @seleniumbuilder