SELENIUMMichael Palotas, GRIDFUSION Software SolutionsFebruary 5 2013                                                 GRID...
TODAYS TOPICS●   A few thoughts on automation●   Selenium Tool Family Overview    –   Selenium History    –   IDE    –   W...
WHO AM I ?                             MICHAEL PALOTAS                      Dipl. Ing. (FH) Nachrichtentechnik            ...
SELENIUM VS. QTP JOB TRENDS4                             GRIDFUSION.NET
A FEW THOUGHTS ON TEST AUTOMATION●   Manual testing is still very important●   E2E tests are expensive, so keep them to th...
SELENIUM AUTOMATES BROWSERS                               THATS IT                               ... kind of    Selenium i...
SELENIUM FLAVORS                   Selenium RC                                              Selenium GRID                 ...
SELENIUM IDEWhat it is:     –   First Selenium experience for many people     –   Firefox add-on     –   Record & playback...
SELENIUM (WEBDRIVER)What it is :     –   Web testing tool     –   Highly successful open source project     –   StableTech...
WHAT IT IS NOT- a drag & drop tool- a network testing / monitoring tool- a performance testing tool- a reporting tool12   ...
2 PIECES     client   json wire protocol   server13                                          GRIDFUSION.NET
CLIENT●    What testers "see" as selenium●    It doesnt "do" anything except generates Http requests     that will be hand...
SERVER●    Where all the action happens●    Where the contributors spend their time●    Drives the browser under test●    ...
BASIC ARCHITECTURE         Language          Bindings                     SELENIUM Server           Client TESTS          ...
TESTSTests are java executable code and can be run:     –   Manually from a personal machine, using an         IDE     –  ...
TEST EXAMPLE     @Test     public void localBrowserTest() throws MalformedURLException{     System.out.println("starting t...
GRID●    Scale●    Run tests in parallel●    Reduce test execution times●    Crossover Tests (Web, Mobile, Desktop)19     ...
SELENIUM GRID     SEQUENTIAL EXECUTION               PARALLEL EXECUTION                                        TEST   TEST...
GRID                               D      IE                 NODE 1                           S     CI          (WIN)     ...
PUTTING IT INTO ACTION (WITHOUT GRID)Start the Selenium Server     –   java -jar selenium-server-standalone-x.y.z.jarDONE ...
PUTTING IT INTO ACTION WITH GRIDStart the Selenium GRID hub     –   Java -jar selenium-server-standalone-x.y.z.jar -role h...
MOBILE●    Mobile automation should be compatible /     similar to Web automation●    Mobile Web automation is less of a p...
IOS-DRIVER●    Implements the JSON wire protocol●    Runs on emulators and devices●    Can be run as a regular node in a S...
WHY ALL IN ONE GRID ?●    Web and mobile are converging●    Users are moving between devices (i.e. Web     (in the office)...
PAGE OBJECTS•http://code.google.com/p/selenium/wiki/PageObjects•Page objects model the pages and page interactions•Reduce ...
WHY OPEN SOURCE?●    Accelerator for innovation●    Independence from vendors●    Worldwide support and contributions●    ...
USEFUL LINKS●    Selenium Homepage: http://seleniumhq.org/●    Selenium Download: http://seleniumhq.org/download/●    Wiki...
THANK YOU!                   QUESTIONS?                   COMMENTS?                       CONTACT:            GRIDFUSION, ...
Upcoming SlideShare
Loading in …5
×

OpenTuesday: Die Selenium-Toolfamilie und ihr Einsatz im Web- und Mobile-Automatisierungsumfeld

1,228 views
1,134 views

Published on

Dieses OpenTuesday-Referat zeigt den Einsatz der Selenium-Toolfamilie in einem hochskalierbaren Web- und Mobile-Umfeld anhand von praktischen Beispielen. Ebenso werden die Vorteile von Open Source Tools in Bezug auf Konkurrenzfähigkeit und Innovationskraft von Unternehmen aufgezeigt.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,228
On SlideShare
0
From Embeds
0
Number of Embeds
102
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

OpenTuesday: Die Selenium-Toolfamilie und ihr Einsatz im Web- und Mobile-Automatisierungsumfeld

  1. 1. SELENIUMMichael Palotas, GRIDFUSION Software SolutionsFebruary 5 2013 GRIDFUSION.NET
  2. 2. TODAYS TOPICS● A few thoughts on automation● Selenium Tool Family Overview – Selenium History – IDE – WebDriver – GRID● Demo(s)● Mobile and Selenium● Why Open Source ?2 GRIDFUSION.NET
  3. 3. WHO AM I ? MICHAEL PALOTAS Dipl. Ing. (FH) Nachrichtentechnik michael.palotas@gridfusion.net http://gridfusion.net http://ch.linkedin.com/in/michaelpalotas http://www.xing.com/profile/Michael_PalotaseBay GRIDFUSIONHead of Quality Engineering Europe Founder & Principal Consultant3 GRIDFUSION.NET
  4. 4. SELENIUM VS. QTP JOB TRENDS4 GRIDFUSION.NET
  5. 5. A FEW THOUGHTS ON TEST AUTOMATION● Manual testing is still very important● E2E tests are expensive, so keep them to the minimum● Automation is software development● Be careful with record & playback tools● Automate the repetitive tasks (regression)● Build testability into your product● ROI...● More at http://gridfusion.net/thoughtsonautomation.html5 GRIDFUSION.NET
  6. 6. SELENIUM AUTOMATES BROWSERS THATS IT ... kind of Selenium is becoming a W3C standard: http://www.w3.org/TR/webdriver7 GRIDFUSION.NET
  7. 7. SELENIUM FLAVORS Selenium RC Selenium GRID (deprecated) Selenium IDE WebDriver8 GRIDFUSION.NET
  8. 8. SELENIUM IDEWhat it is: – First Selenium experience for many people – Firefox add-on – Record & playback solution – Not maintainableWhat it is for: – Quick reproduction of scenarios & bugs – Products with few testcases & low change frequency – Help to write the „real tests“ – Find IDs / XPATH etc. 9 GRIDFUSION.NET
  9. 9. SELENIUM (WEBDRIVER)What it is : – Web testing tool – Highly successful open source project – StableTechnical : – Protocol describing the user interactions – Supports most browser implementations – Support for most common programming languages11 GRIDFUSION.NET
  10. 10. WHAT IT IS NOT- a drag & drop tool- a network testing / monitoring tool- a performance testing tool- a reporting tool12 GRIDFUSION.NET
  11. 11. 2 PIECES client json wire protocol server13 GRIDFUSION.NET
  12. 12. CLIENT● What testers "see" as selenium● It doesnt "do" anything except generates Http requests that will be handled by the server● It is the part that will be called : – By the test framework – By the CI server● Officially supported languages: java, c#, python,ruby● Not officially supported : perl, php, js14 GRIDFUSION.NET
  13. 13. SERVER● Where all the action happens● Where the contributors spend their time● Drives the browser under test● Supported by the Selenium team: IE, Firefox, Safari● Supported by vendors: Chrome, Opera15 GRIDFUSION.NET
  14. 14. BASIC ARCHITECTURE Language Bindings SELENIUM Server Client TESTS (& BROWSER GRID)16 GRIDFUSION.NET
  15. 15. TESTSTests are java executable code and can be run: – Manually from a personal machine, using an IDE – Automatically from a continuous integration server17 GRIDFUSION.NET
  16. 16. TEST EXAMPLE @Test public void localBrowserTest() throws MalformedURLException{ System.out.println("starting test"); DesiredCapabilities capability = DesiredCapabilities.chrome(); WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability); driver.get("http://www.digicomp.ch"); WebElement searchBox = driver.findElement(By.id("q")); searchBox.sendKeys("Selenium"); WebElement go = driver.findElement(By.className("submitsearch")); go.click(); Assert.assertEquals(driver.getTitle(), "Digicomp"); System.out.println("Page Title: " + driver.getTitle()); driver.quit(); }18 GRIDFUSION.NET
  17. 17. GRID● Scale● Run tests in parallel● Reduce test execution times● Crossover Tests (Web, Mobile, Desktop)19 GRIDFUSION.NET
  18. 18. SELENIUM GRID SEQUENTIAL EXECUTION PARALLEL EXECUTION TEST TEST TEST TEST n n TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TIME TIME20 GRIDFUSION.NET
  19. 19. GRID D IE NODE 1 S CI (WIN) D FF D OPERA GRID NODE 2 CLIENT S HUB (LINUX) D CHROME . . CLIENT . NODE n S21 GRIDFUSION.NET
  20. 20. PUTTING IT INTO ACTION (WITHOUT GRID)Start the Selenium Server – java -jar selenium-server-standalone-x.y.z.jarDONE Language Bindings Client BROWSER TESTS SELENIUM Server22 GRIDFUSION.NET
  21. 21. PUTTING IT INTO ACTION WITH GRIDStart the Selenium GRID hub – Java -jar selenium-server-standalone-x.y.z.jar -role hub – Check: http://ipaddress:4444/grid/consoleStart a Selenium Node & register with the hub – java -jar selenium-server-standalone-x.y.z.jar -role node -hub http://ipaddress:4444/grid/registerOR to specify Browser / OS – java -jar selenium-server-standalone-x.y.z.jar -role node -hub http://ipadress:4444/grid/register -browser browserName=firefox,maxInstances=4,platform=LINUX Chrome Language Bindings GRID Client TESTS NODE Server HUB FF24 GRIDFUSION.NET
  22. 22. MOBILE● Mobile automation should be compatible / similar to Web automation● Mobile Web automation is less of a problem● Native App automation is more difficult● Mobile Web: android-driver / iphone-driver● Native apps: calabash-driver, ios-driver26 GRIDFUSION.NET
  23. 23. IOS-DRIVER● Implements the JSON wire protocol● Runs on emulators and devices● Can be run as a regular node in a Selenium Grid● No need to change the source● No need to jailbreak the device● No ios-driver app to install on the phone● http://freynaud.github.com/ios-driver/27 GRIDFUSION.NET
  24. 24. WHY ALL IN ONE GRID ?● Web and mobile are converging● Users are moving between devices (i.e. Web (in the office) -> Android Phone (on the train) -> iPad (at home on the couch)● Need to ensure consistent user experience and functionality28 GRIDFUSION.NET
  25. 25. PAGE OBJECTS•http://code.google.com/p/selenium/wiki/PageObjects•Page objects model the pages and page interactions•Reduce code duplication•Reduce maintenance effort•Easy international support•Public methods represent the service of a page 31 GRIDFUSION.NET
  26. 26. WHY OPEN SOURCE?● Accelerator for innovation● Independence from vendors● Worldwide support and contributions● It is free (...kind of)● Motivator for employees● External recognition for employees33 GRIDFUSION.NET
  27. 27. USEFUL LINKS● Selenium Homepage: http://seleniumhq.org/● Selenium Download: http://seleniumhq.org/download/● Wiki: http://code.google.com/p/selenium/w/list35 GRIDFUSION.NET
  28. 28. THANK YOU! QUESTIONS? COMMENTS? CONTACT: GRIDFUSION, MICHAEL PALOTAS GERBIWEG 2, 8853 LACHEN, Tel.: +41 44 577 1555 michael.palotas@gridfusion.net http://gridfusion.net36 GRIDFUSION.NET

×