Introducing Selenium Builder – the Future of Test Development

7,027 views

Published on

Published in: Technology

Introducing Selenium Builder – the Future of Test Development

  1. 1. Se BuilderLets talk about the future. @admc @zarkonnen_com
  2. 2. History● Windmill● GTI● Se Builder 1 release● People care
  3. 3. 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
  4. 4. Usage
  5. 5. Community● We need community● We need plugins● We need multiple browsers● We need your help
  6. 6. David Stark● Originally drafted to fix some bugs in GTI● Rewrote most of it → Se Builder
  7. 7. Se Builder: It does both● Same UX for Selenium 1/2● Easier start with Selenium 2● Transition path
  8. 8. Selenium 1 Support● A simple alternative to Selenium IDE
  9. 9. Selenium 1: Recording
  10. 10. Selenium 1: Editing
  11. 11. Selenium 1: Playback
  12. 12. Selenium 1: Save/Load
  13. 13. Selenium 1: Suites
  14. 14. Selenium 1: Extensions● user_extensions.js● Compatible with Selenium IDE
  15. 15. 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
  16. 16. 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/
  17. 17. Result: Identical UX
  18. 18. 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" } } ]}
  19. 19. Converting● Can automatically convert some scripts● Upgrade path● "What would this look like in Selenium 2?" FirefoxDriver wd = new FirefoxDriver ();open http://www.sebuilder.com/ wd.manage().timeouts().implicitlyWait( 60, TimeUnit.SECONDS); wd.get("http://www.sebuilder.com/ ");waitForPageToLoad 60000 if (!wd.getTitle().equals( "Se Builder" )){ wd.close(); throw new RuntimeException ("failed");assertTitle Se Builder } wd.close();
  20. 20. Selenium 2 Support● Record● Edit● Play back● Load, save & export
  21. 21. Architecture● Based on HTML/JS/jQuery● Thin XUL wrapper● Mostly browser-agnostic Window: XUL Se Builder Code HTML/JS/jQuery
  22. 22. Architecture● Selenium version-agnostic Selenium 1 Converter Selenium 2 Menus, etc. Script Editing GUI Recording Common data structures HTML/JS/jQuery
  23. 23. Kill version-specific code Selenium 1 Rec Converter Selenium 2 Rec All GUI Code Common data structures HTML/JS/jQuery
  24. 24. Goal: Modularity● List of n (= 2) supported script types● Extensible list of step types● Extensible list of export formats● Extensible GUI
  25. 25. // TODO● Se Builder is in Beta● Want more features● Want fewer bugs
  26. 26. Broader Support● More step types● More export languages and frameworks: JUnit, TestNG, C#, Ruby, Perl● Its easy
  27. 27. Beautiful exported code● Its important● Need consistent test behaviour● Exported code used as base for more code● Set a good example● Help establish good practices
  28. 28. Selenium 2 Suites● Format for storing suites● Based on JSON● Exporting suites to code
  29. 29. Extensibility● Ecosystem of plugins is key● Custom steps and export formats● Custom widgets● Flash support, etc.● Keep core Se Builder simple
  30. 30. Step Plugins● Definition of new steps (name, parameters)● Record code● Playback code● Export code● Selenium 2 JSON specifies plugins
  31. 31. GUI Plugins● HTML/JS/jQuery makes this easy● Define listeners● Define widget attachment points● Good hooks → clean extensions● What hooks do you need?
  32. 32. 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?
  33. 33. Wanted: Contributors● Try it out and give feedback● Write about it● Fix bugs● Improve quality of exported code● Add a new export language/framework● Its on GitHub: fork it & add new features!
  34. 34. What now?● Get involved● Lets make some plans● Lets unify and execute
  35. 35. Questions● You know you do.
  36. 36. Thanks!@seleniumconf is awesome.● sebuilder.com● github.com/admc/se-builder● @admc, @zarkonnen_com● @seleniumbuilder

×