SlideShare a Scribd company logo
Automated UI testing.
     Selenium
Gold Sponsor of
DrupalCamp Kyiv 2011
Silver Sponsors of
DrupalCamp Kyiv 2011
Plan

    What is Selenium?

    Selenium IDE, RC, Webdriver

    Integration to Drupal

    Tests API, locators, examples

    Future
What is Selenium?

    Selenium IDE

    Selenium RC

    Selenium Grid

    Selenium 2 (Webdriver)
Selenium IDE

    Addon to Firefox

    Easy to start using

    Can record tests in PHP

    Demo
Selenium RC

    Run in multiple browsers in Virtual Boxes

    Runs tests via Javascript
Selenium RC

     To install Selenium RC download java server
    from http://seleniumhq.org/download

    Run Selenium IDE tests via PHPUnit
     
         Ubuntu: apt-get install phpunit
     
         If php 5.2 make a preference for karmic like for
         php

    Demo
Selenium 2 Webdriver

    Communicate with browsers in 'native' way via
    drivers

     Not limited to javascripts. For example: upload
    files, work with popups, iframes etc.

    Support for a lot of browsers including mobile
    phone browsers

    PHPUnit libraries:
    https://github.com/chibimagic/WebDriver-PHP
Selenium2 Webdriver and Drupal

    How to integrate to simpletest
     
         In order to get into sandbox we need to set
         headers
     
         This is possible with Firefox only (send custom
         profile to Selenium)

    http://drupal.org/project/selenium

    Demo
Drupal tests API

    Main class DrupalSeleniumWebTestCase

    Init driver as connection to Selenium server

    Already implemented methods:
     
         drupalOpenUrl, drupalLogin, drupalLogout,
         verboseScreenshot ...

     class SeleniumWebElement (sendKeys, click,
    submit, getText...)
Selenium 2 locators
css, id, name, class, link, xpath
XPath vs CSS locators
Selenium RC has sizzle
Webdriver uses native browsers CSS selectors.
CSS selectors are faster
XPath can go up
Example:
id('user1')/../../td[@class="actions"]/a[@class="delete-user"]
Drag and drop example
Run tests on headless server

     Key tool: Xvfb – X11 server that performs all graphical
    operations in memory, not showing any screen output
    (http://en.wikipedia.org/wiki/Xvfb).

    Before we start Selenium server we need to start Xvfb.

    Run tests from shell:
sudo -u www-data php ./scripts/run-tests.sh --url http://URL --class
   SeleniumTestExample
Future

    Implement methods from DrupalWebTestCase

    Start using Selenium in testing contrib modules
    and core (module draggableviews already have
    one selenium test)
References

     Selenium RC supported browsers http://www.seleniumwiki.com/software-
    testing/selenium-supported-browsers

    PHPUnit documentation about Selenium
    http://www.phpunit.de/manual/3.5/en/selenium.html#selenium.selenium-rc

    http://ygerasimov.com/integrating-selenium-to-drupal-simpletest-framework

    http://ygerasimov.com/run-selenium-tests-drupal-on-debian-headless

    http://ygerasimov.com/drupal-selenium-tests-api
Questions
Ваша фотка   email: yuri.gerasimov@gmail.com
             twitter: ygerasimov
             skype: yuriy_gerasimov
               d.o.: http://drupal.org/user/257311

More Related Content

What's hot (20)

DOCX
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
PDF
Basics of Selenium IDE,Core, Remote Control
usha kannappan
 
PPTX
Selenium - Introduction
Sachin-QA
 
PDF
Selenium 2 - PyCon 2011
hugs
 
PPTX
Python selenium
Ducat
 
PPTX
Introduction to selenium
Archana Krushnan
 
PPTX
Automation - web testing with selenium
Tzirla Rozental
 
PDF
Web automation using selenium.ppt
Ana Sarbescu
 
PPT
Selenium
Ruturaj Doshi
 
PPT
Selenium 2: The Future of Selenium is now!
AutomatedTester
 
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
RIA RUI Society
 
PDF
How To Use Selenium Successfully (Java Edition)
Sauce Labs
 
PDF
Selenium Framework using Java | Selenium Tutorial | Selenium Training Online ...
Edureka!
 
PPT
Selenium Primer
gueste1e4db
 
PPT
Selenium (1)
onlinemindq
 
PPTX
Selenium
傑倫 鍾
 
PDF
Introduction to Selenium Automation
Mindfire Solutions
 
PPTX
Selenium
Satyam Pandey
 
PPT
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
PPTX
Selenium Webdriver
Muhammad Bilal
 
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
Basics of Selenium IDE,Core, Remote Control
usha kannappan
 
Selenium - Introduction
Sachin-QA
 
Selenium 2 - PyCon 2011
hugs
 
Python selenium
Ducat
 
Introduction to selenium
Archana Krushnan
 
Automation - web testing with selenium
Tzirla Rozental
 
Web automation using selenium.ppt
Ana Sarbescu
 
Selenium
Ruturaj Doshi
 
Selenium 2: The Future of Selenium is now!
AutomatedTester
 
Smarter ways to do selenium automation @ work, Selenium, automation
RIA RUI Society
 
How To Use Selenium Successfully (Java Edition)
Sauce Labs
 
Selenium Framework using Java | Selenium Tutorial | Selenium Training Online ...
Edureka!
 
Selenium Primer
gueste1e4db
 
Selenium (1)
onlinemindq
 
Selenium
傑倫 鍾
 
Introduction to Selenium Automation
Mindfire Solutions
 
Selenium
Satyam Pandey
 
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
Selenium Webdriver
Muhammad Bilal
 

Viewers also liked (7)

PDF
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Oleg Natalushko. Drupal server anatomy. DrupalCamp Kyiv 2011
Vlad Savitsky
 
PDF
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Vadim Mirgorod.OpenAcaDept.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
camp_drupal_ua
 
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Oleg Natalushko. Drupal server anatomy. DrupalCamp Kyiv 2011
Vlad Savitsky
 
Grigory Naumovets.Multilingual sites.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Vadim Mirgorod.OpenAcaDept.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
camp_drupal_ua
 
Ad

Similar to Automated UI testing.Selenium.DrupalCamp Kyiv 2011 (20)

PPT
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
PDF
Selenium 2 for PHP(Unit)
AOE
 
PPTX
Test Automation Using Selenium
Nikhil Kapoor
 
ODP
Automated ui testing with selenium. drupal con london 2011
Yuriy Gerasimov
 
PPT
Selenium
shrialinda
 
PPTX
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
PPTX
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
PDF
Selenium 2 for PHP(Unit)
AOE
 
PPT
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Puneet Kala
 
DOC
Selenium Automation Using Ruby
Kumari Warsha Goel
 
PDF
Selenium Ide Tutorial
metapix
 
PPTX
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Simplilearn
 
ODP
Mastering selenium for automated acceptance tests
Nick Belhomme
 
PPTX
Selenium.pptxgsjdxhasdjhckcjjkdcbdcbvdciosdc
sumanthveeramallu9
 
PPTX
Step by step instructions to execute selenium automation testing
Alisha Henderson
 
PPTX
Selenium Automation
Anuradha Malalasena
 
PPTX
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
PPTX
Selenium – testing tool jack
Jackseen Jeyaluck
 
PPTX
Selenium presentation
shivani thakur
 
PPTX
Selenium
Mayuresh Wadekar
 
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
Selenium 2 for PHP(Unit)
AOE
 
Test Automation Using Selenium
Nikhil Kapoor
 
Automated ui testing with selenium. drupal con london 2011
Yuriy Gerasimov
 
Selenium
shrialinda
 
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
Selenium 2 for PHP(Unit)
AOE
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Puneet Kala
 
Selenium Automation Using Ruby
Kumari Warsha Goel
 
Selenium Ide Tutorial
metapix
 
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Simplilearn
 
Mastering selenium for automated acceptance tests
Nick Belhomme
 
Selenium.pptxgsjdxhasdjhckcjjkdcbdcbvdciosdc
sumanthveeramallu9
 
Step by step instructions to execute selenium automation testing
Alisha Henderson
 
Selenium Automation
Anuradha Malalasena
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Selenium – testing tool jack
Jackseen Jeyaluck
 
Selenium presentation
shivani thakur
 
Ad

More from camp_drupal_ua (20)

ODP
Peter Lozovitsky.Money under your feet or why you have not already training i...
camp_drupal_ua
 
PDF
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
camp_drupal_ua
 
PDF
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
camp_drupal_ua
 
PDF
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
camp_drupal_ua
 
PDF
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
camp_drupal_ua
 
PDF
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Grigory naumovets.multilingual sites.drupal camp kyiv 2011
camp_drupal_ua
 
PDF
Ramil Kinzyabulatov.Organization online store.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Ilivanov Alexander.How to make best theme.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
camp_drupal_ua
 
Peter Lozovitsky.Money under your feet or why you have not already training i...
camp_drupal_ua
 
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
camp_drupal_ua
 
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
camp_drupal_ua
 
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
camp_drupal_ua
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
camp_drupal_ua
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Grigory naumovets.multilingual sites.drupal camp kyiv 2011
camp_drupal_ua
 
Ramil Kinzyabulatov.Organization online store.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Ilivanov Alexander.How to make best theme.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Roman Chernov.Panels custom layouts.DrupalCampKyiv 2011
camp_drupal_ua
 

Recently uploaded (20)

PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 

Automated UI testing.Selenium.DrupalCamp Kyiv 2011

  • 4. Plan  What is Selenium?  Selenium IDE, RC, Webdriver  Integration to Drupal  Tests API, locators, examples  Future
  • 5. What is Selenium?  Selenium IDE  Selenium RC  Selenium Grid  Selenium 2 (Webdriver)
  • 6. Selenium IDE  Addon to Firefox  Easy to start using  Can record tests in PHP  Demo
  • 7. Selenium RC  Run in multiple browsers in Virtual Boxes  Runs tests via Javascript
  • 8. Selenium RC  To install Selenium RC download java server from http://seleniumhq.org/download  Run Selenium IDE tests via PHPUnit  Ubuntu: apt-get install phpunit  If php 5.2 make a preference for karmic like for php  Demo
  • 9. Selenium 2 Webdriver  Communicate with browsers in 'native' way via drivers  Not limited to javascripts. For example: upload files, work with popups, iframes etc.  Support for a lot of browsers including mobile phone browsers  PHPUnit libraries: https://github.com/chibimagic/WebDriver-PHP
  • 10. Selenium2 Webdriver and Drupal  How to integrate to simpletest  In order to get into sandbox we need to set headers  This is possible with Firefox only (send custom profile to Selenium)  http://drupal.org/project/selenium  Demo
  • 11. Drupal tests API  Main class DrupalSeleniumWebTestCase  Init driver as connection to Selenium server  Already implemented methods:  drupalOpenUrl, drupalLogin, drupalLogout, verboseScreenshot ...  class SeleniumWebElement (sendKeys, click, submit, getText...)
  • 12. Selenium 2 locators css, id, name, class, link, xpath
  • 13. XPath vs CSS locators Selenium RC has sizzle Webdriver uses native browsers CSS selectors. CSS selectors are faster XPath can go up Example: id('user1')/../../td[@class="actions"]/a[@class="delete-user"]
  • 14. Drag and drop example
  • 15. Run tests on headless server  Key tool: Xvfb – X11 server that performs all graphical operations in memory, not showing any screen output (http://en.wikipedia.org/wiki/Xvfb).  Before we start Selenium server we need to start Xvfb.  Run tests from shell: sudo -u www-data php ./scripts/run-tests.sh --url http://URL --class SeleniumTestExample
  • 16. Future  Implement methods from DrupalWebTestCase  Start using Selenium in testing contrib modules and core (module draggableviews already have one selenium test)
  • 17. References  Selenium RC supported browsers http://www.seleniumwiki.com/software- testing/selenium-supported-browsers  PHPUnit documentation about Selenium http://www.phpunit.de/manual/3.5/en/selenium.html#selenium.selenium-rc  http://ygerasimov.com/integrating-selenium-to-drupal-simpletest-framework  http://ygerasimov.com/run-selenium-tests-drupal-on-debian-headless  http://ygerasimov.com/drupal-selenium-tests-api
  • 18. Questions Ваша фотка email: [email protected] twitter: ygerasimov skype: yuriy_gerasimov d.o.: http://drupal.org/user/257311