Your SlideShare is downloading. ×
Selenium
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Selenium

5,950
views

Published on

Automated testing using Selenium

Automated testing using Selenium

Published in: Education, Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,950
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
243
Comments
0
Likes
2
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. SELENIUM
  • 2. Speakers  Aaron Tinio • atinio@g2ix.com  Bernard Lago • blago@g2ix.com
  • 3. Goals • To be able to consider implementation of automated testing • To jumpstart Selenium usage
  • 4. Pre-requisites • HTML • Javascript • Ruby or other scripting/programming language
  • 5. Selenium 101  Selenium Introduction  Selenium IDE Basics  Selenium RC Basics  Selenium GRID Demo
  • 6. SELENIUM INTRODUCTION
  • 7. Selenium Introduction  Why choose Selenium?  Types of Functional Test Tools for Web Apps  “Flavors” of Selenium  Selenium IDE Basics
  • 8. Why choose Selenium?  Open source  Backed by Industry Players  Stable and Well Tested  Platform-independent  Uses a real browser  Allows you to use your favorite programming language
  • 9. Types of Functional Test Tools  Use of a simulated browser: HttpUnit, HtmlUnit & WebTest  Use of a real browser: Selenium, Watir (and FireWatir and SafariWatir)
  • 10. Flavors of Selenium  Selenium Core  Selenium IDE  Selenium RC (and Selenium Grid)
  • 11. SELENIUM IDE
  • 12. Selenium IDE  Installation, overview and usage  Locators  Actions, Accessors, Assertions  Patterns
  • 13. Locators  id • id=gbar  name • name=q  dom • dom=document.links[0]  xpath • xpath=//html/body/center/form/table/tbody/tr/td[2]/input[2]  link • link=English
  • 14. Actions  open(url)  click(locator)  type(locator, value)  select(locator, optionLocator)
  • 15. Accessors • storeText(locator, variableName) • from getText(locator) command • storeLocation(variableName) • from getLocation() command
  • 16. Assertions • assertText(locator, pattern) • from getText(locator) command • assertLocation(pattern) • from getLocation() command OTHER ASSERTIONS: • verifyText • waitForText • verifyLocation • waitForLocation
  • 17. Patterns  exact • exact:Google.com in English  glob • glob:*in English  regexp • regexp:Go+gle.com in English  regexpi • regexpi:go+gle.com in english
  • 18. SELENIUM REMOTE CONTROL
  • 19. Selenium Remote Control  Selenium RC Architecture  Selenium RC Server  Selenium RC Ruby Client Driver  Testing Frameworks for Ruby  Prototyping tests in IRB  Writing tests (Ruby / Test::Unit)
  • 20. Selenium RC Architecture
  • 21. Selenium Server: Interactive Mode  is a way of rapidly prototyping tests.  requires no coding whatsoever.  allows you to immediately see the results. Starting the server in interactive mode: java -jar selenium-server.jar -interactive [otherOptions]
  • 22. Selenium RC (Ruby Client Driver) • requires ruby • requires rubygems • requires selenium-client gem • gem install selenium-client
  • 23. Testing Frameworks (Ruby) • Test-Driven Development (TDD) • Test::Unit • Behaviour-Driven Development (BDD) • Rspec • TDD + BDD • Shoulda • test/spec
  • 24. Interactive Ruby Shell • is a shell for programming in the Ruby language • allows the programmer to experiment with codes
  • 25. Writing tests (Ruby / Test::Unit)  Require the following in the test script • 'rubygems' • 'selenium/client' • 'test/unit'  Create a class that subclasses Test::Unit::TestCase.  Define “setup” method to set up the common test fixture. • create a new Selenium::Client::Driver object • run the “start” method on the selenium driver object  Add a method that begins with quot;testquot; to the class. • make assertions in the test method.  Define “teardown” method to tear down the test fixture. • run to “stop” method on the selenium driver object
  • 26. Writing tests (Example)
  • 27. SELENIUM GRID
  • 28. Selenium Grid • Selenium Grid Architecture • Selenium Grid Demo
  • 29. Selenium Grid Architecture
  • 30. Selenium Grid Demo • Running scripts on multiple machines using different browsers • Sample Environment Configurations • Firefox on Linux • Internet Explorer on Windows • Firefox on Windows
  • 31. QUESTIONS ???
  • 32. REFERENCES
  • 33. References • http://seleniumhq.org/projects/ide/ • http://seleniumhq.org/projects/core/ • http://seleniumhq.org/projects/remote-control/ • http://selenium-client.rubyforge.org/ • http://selenium-grid.seleniumhq.org/
  • 34. Maestrodev • www.maestrodev.com • Forums • Downloads • Announcements
  • 35. Thank you!!!