• Like

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.

Dov'è il tasto ok?

  • 700 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
700
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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