introducing selenium builder – the future of test development
TRANSCRIPT
![Page 1: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/1.jpg)
Se BuilderLet's talk about the future.
@admc @zarkonnen_com
![Page 2: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/2.jpg)
History
● Windmill● GTI● Se Builder 1 release● People care
![Page 3: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/3.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/4.jpg)
Usage
![Page 5: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/5.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/6.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/8.jpg)
Selenium 1 Support
● A simple alternative to Selenium IDE
![Page 9: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/9.jpg)
Selenium 1: Recording
![Page 10: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/10.jpg)
Selenium 1: Editing
![Page 11: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/11.jpg)
Selenium 1: Playback
![Page 12: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/12.jpg)
Selenium 1: Save/Load
![Page 13: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/13.jpg)
Selenium 1: Suites
![Page 14: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/14.jpg)
Selenium 1: Extensions
● user_extensions.js● Compatible with Selenium IDE
![Page 15: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/16.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/17.jpg)
Result: Identical UX
![Page 18: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/18.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/19.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/20.jpg)
Selenium 2 Support● Record● Edit● Play back● Load, save & export
![Page 21: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/21.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/22.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/23.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/24.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/25.jpg)
// TODO
● Se Builder is in Beta● Want more features● Want fewer bugs
![Page 26: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/26.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/27.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/28.jpg)
Selenium 2 Suites
● Format for storing suites● Based on JSON● Exporting suites to code
![Page 29: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/29.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/30.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/31.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/32.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/33.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/34.jpg)
What now?
● Get involved● Let's make some plans● Let's unify and execute
![Page 35: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/35.jpg)
Questions
● You know you do.
![Page 36: Introducing Selenium Builder – the Future of Test Development](https://reader036.vdocuments.net/reader036/viewer/2022062313/5594889b1a28ab177d8b4619/html5/thumbnails/36.jpg)
Thanks!
@seleniumconf is awesome. ● sebuilder.com● github.com/admc/se-builder● @admc, @zarkonnen_com● @seleniumbuilder