Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Dov'è il tasto ok?

on

  • 945 views

Introduction to functional test with selenium rc, selenium ide and phpunit integration

Introduction to functional test with selenium rc, selenium ide and phpunit integration

Statistics

Views

Total Views
945
Views on SlideShare
945
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Dov'è il tasto ok? Dov'è il tasto ok? Presentation Transcript

      • Dov'è il tasto Ok???
        Michele Orselli
      • Who am I
      Michele Orselli
        • Developer @Ideato
        • Email: [email_address]
        • Twitter: _ orso _
    • This site is broken! Credits: http://thedailywtf.com/
    • This site is broken! Credits: http://thedailywtf.com/
    • This site is broken! Credits: http://thedailywtf.com/
    • Testing and You How do you ensure software quality?
        • Testing?
        • QA?
    • Testing Triangle Credits: http://patrickwilsonwelsh.com/?p=32
    • Functional Tests
      • Check a feature from the user's point of view
        • Great for QA
      • Pros & Cons
      • Not a substitute for unit test
    • Selenium Remote Control
        • Java Based
        • Open Source
      IDE
        • Firefox extension
        • Record and Playback
    • Where to use it
      • Acceptance Test
      • Bug Report
      • Performance
      • Cross-browser compatibility
    • Selenium RC Architecture Credits: http://seleniumhq.org/
    • Getting Started Download
        • http://selenium.googlecode.com/files/selenium-remote-control-1.0.3.zip
      Unzip Java -jar selenium-server.jar
        • Options:
          • port
          • timeout
          • log
          • HtmlSuite
          • -h show all available options
    • Selenium API Browser-independent API
        • Same test run on several os/browser
      Bindings for several languages Base API:
        • Assert*
        • Verify*
        • WaitFor*
    • A first test (Selenese) open /web/listaeventi.php assertTextPresent Faccio cose vedo gente Plain HTML Table: ... ... ...
    • A first test (PHPUnit)
    • Where's the OK button? (1)
    • Where's the Ok button? (2)
    • Where's the Ok button? (3)
    • Finding Elements Identifing elements:
        • identifier=id: @id/@name
        • id=id: Select the element with the specified @id attribute.
        • name=name: Select the first element with the specified @name attribute.
        • dom=function foo() { return document.links[1]; }; foo();
        • link=textPattern
      http://release.seleniumhq.org/selenium-remote/control/0.9.2/doc/dotnet/Selenium.html
    • Finding Elements String-match Patterns
        • glob:pattern:
          • "*": any sequence of characters
          • "?": any single character.
          • Glob patterns match against the entire string.
        • regexp:regexp: match a string using a regular-expression.
        • exact:string: match a string exactly
    • Finding Elements (2) Resolving strategies:
        • dom, for locators starting with "document."
        • xpath, for locators starting with "//"
        • identifier, otherwise
    • Css Selectors
      • all css1, css2 and css3 selectors (except namespaces in css3)
        • css=a[href="#id3"]
        • css=span#firstChild + span
      • pseudo classes
        • :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type
        • :visited, :hover, :active, :focus
      • pseudo elements
        • ::first-line,::first-letter, ::selection, ::before, ::after
      • examples:
        • div#id, div.class, div > p > a
        • a[href=”http://www.google.com”]
    • Xpath Selectors Level Separator: / Every Level: // Wildcard: * Attribute: @ Wildcard @* Examples:
        • xpath=//img[@alt='The image alt text']
        • xpath=//table[@id='table1']//tr[4]/td[2]
        • xpath=//a[contains(@href,'#id1')]
    • Demo
    • Limitation Test are sloooooooow
        • Reuse browser session
        • Test are not indipendent
      Expressiveness
        • Build your own DSL on top of selenium
    • Beyond Selenium Get rid of the browser!
        • Framework-dependent approaches (eg: symfony)
        • Generic, curl-style based
          • https://github.com/enygma/frisk
          • PHPUnitWebBrowser
          • everzet.com/behat
    • Demo
    • We're done! Q&A
    • Thank you! Email: [email_address] Twitter: _ orso _ Please rate my talk!
        • http://joind.in/2120