Introducing Selenium Builder – the Future of Test Development

36
Se Builder Let's talk about the future. @admc @zarkonnen_com

Transcript of Introducing Selenium Builder – the Future of Test Development

Page 1: Introducing Selenium Builder – the Future of Test Development

Se BuilderLet's talk about the future.

@admc @zarkonnen_com

Page 2: Introducing Selenium Builder – the Future of Test Development

History

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

Page 3: Introducing Selenium Builder – the Future of Test Development

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

Page 4: Introducing Selenium Builder – the Future of Test Development

Usage

Page 5: Introducing Selenium Builder – the Future of Test Development

Community

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

Page 6: Introducing Selenium Builder – the Future of Test Development

David Stark

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

Page 7: Introducing Selenium Builder – the Future of Test Development

Se Builder: It does both

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

Page 8: Introducing Selenium Builder – the Future of Test Development

Selenium 1 Support

● A simple alternative to Selenium IDE

Page 9: Introducing Selenium Builder – the Future of Test Development

Selenium 1: Recording

Page 10: Introducing Selenium Builder – the Future of Test Development

Selenium 1: Editing

Page 11: Introducing Selenium Builder – the Future of Test Development

Selenium 1: Playback

Page 12: Introducing Selenium Builder – the Future of Test Development

Selenium 1: Save/Load

Page 13: Introducing Selenium Builder – the Future of Test Development

Selenium 1: Suites

Page 14: Introducing Selenium Builder – the Future of Test Development

Selenium 1: Extensions

● user_extensions.js● Compatible with Selenium IDE

Page 15: Introducing Selenium Builder – the Future of Test Development

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

Page 16: Introducing Selenium Builder – the Future of Test Development

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/

Page 17: Introducing Selenium Builder – the Future of Test Development

Result: Identical UX

Page 18: Introducing Selenium Builder – the Future of Test Development

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" }

} ]}

Page 19: Introducing Selenium Builder – the Future of Test Development

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();

Page 20: Introducing Selenium Builder – the Future of Test Development

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

Page 21: Introducing Selenium Builder – the Future of Test Development

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

Window: XUL

Se Builder CodeHTML/JS/jQuery

Page 22: Introducing Selenium Builder – the Future of Test Development

Architecture

Selenium 2Selenium 1 Converter

Script Editing GUIMenus, etc.

Common data structuresRecording

HTML/JS/jQuery

● Selenium version-agnostic

Page 23: Introducing Selenium Builder – the Future of Test Development

Kill version-specific code

Selenium 2Selenium 1 Converter

All GUI Code

Common data structures

HTML/JS/jQuery

Rec Rec

Page 24: Introducing Selenium Builder – the Future of Test Development

Goal: Modularity

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

Page 25: Introducing Selenium Builder – the Future of Test Development

// TODO

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

Page 26: Introducing Selenium Builder – the Future of Test Development

Broader Support

● More step types● More export languages and frameworks:

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

Page 27: Introducing Selenium Builder – the Future of Test Development

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

Page 28: Introducing Selenium Builder – the Future of Test Development

Selenium 2 Suites

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

Page 29: Introducing Selenium Builder – the Future of Test Development

Extensibility

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

Page 30: Introducing Selenium Builder – the Future of Test Development

Step Plugins

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

Page 31: Introducing Selenium Builder – the Future of Test Development

GUI Plugins

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

Page 32: Introducing Selenium Builder – the Future of Test Development

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?

Page 33: Introducing Selenium Builder – the Future of Test Development

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!

Page 34: Introducing Selenium Builder – the Future of Test Development

What now?

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

Page 35: Introducing Selenium Builder – the Future of Test Development

Questions

● You know you do.

Page 36: Introducing Selenium Builder – the Future of Test Development

Thanks!

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