Testing Grails Applications With Selenium Rc
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Testing Grails Applications With Selenium Rc

  • 6,610 views
Uploaded on

Presentation on testing Grails applications using the Selenium RC Plugin given at the London Groovy & Grails User Group on 20th Nov 2009

Presentation on testing Grails applications using the Selenium RC Plugin given at the London Groovy & Grails User Group on 20th Nov 2009

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
6,610
On Slideshare
6,177
From Embeds
433
Number of Embeds
25

Actions

Shares
Downloads
134
Comments
0
Likes
1

Embeds 433

http://adhockery.blogspot.com 196
http://www.energizedwork.com 59
http://www.slideshare.net 49
http://blog.energizedwork.com 32
http://blog.freeside.co 19
http://www.think-box.co.uk 15
http://adhockery.blogspot.in 15
http://pmomale-ld1 11
http://localhost 11
http://adhockery.blogspot.co.uk 5
http://adhockery.blogspot.com.ar 3
http://adhockery.blogspot.de 3
http://adhockery.blogspot.com.br 2
http://adhockery.blogspot.fi 2
http://adhockery.blogspot.com.au 1
http://adhockery.blogspot.kr 1
http://adhockery.blogspot.gr 1
http://adhockery.blogspot.ca 1
http://adhockery.blogspot.ch 1
http://adhockery.blogspot.dk 1
http://adhockery.blogspot.sg 1
http://feeds.feedburner.com 1
http://adhockery.blogspot.cz 1
http://staging.energizedwork.com 1
http://energizedwork.com 1

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
  • Comparison with webtest/g-func Comparison with Selenium IDE Test examples Running tests Browsers Page Objects Data Driving Spock/BDD
  • Show example suite run
  • Selenese not a 'real' language Sequence, Selection & Iteration (1 out of 3) No encapsulation / modularity
  • Selenese tests as a 'run-on sentence' divide into methods simpler modularity (no custom commands) leads into… less repetition… page object pattern Bits of coverage hide in long tests Temptation to extend tests
  • What is a page object? exposes methods that reflect the things the user can see and do on a page eliminate duplication by building abstractions hides the detail of how code completion tests responsible for assertions, not page object Underlying implementation can be changed
  • Note does not extend or mixin Selenium test classes
  • shows how page object hide detail of implementation Page object handles position of elements in table, test can access by name
  • Factory method that opens URL Navigation method that returns another page object Scrapes error messages and returns in useful form Returns element value if present (can't do in Selenese) Uses MOP to override property access to type in form fields
  • using monolithic data setup Build test data Fixtures tearDown
  • withTransaction blocks ensure data committed and errors thrown right away Importance of tearDown

Transcript

  • 1. Testing Grails Applications with Selenium RC Rob Fletcher, Energized Work
  • 2. Running Selenium RC Tests grails install-plugin selenium-rc grails test-app grails test-app -functional
  • 3. Browsers grails -Dselenium.browser=*firefox test-app
  • 4. Selenium RC vs. Selenium IDE
  • 5. Better Factored Tests
  • 6. Writing Selenium RC Tests
      • Use @Mixin(SeleniumTest)
        • Simple
        • 7. Works with non-JUnit frameworks
      • Extend GrailsSeleniumTestCase
        • Offers Selenese-like assertions, e.g. assertTextPresent
        • 8. Easy migration from Selenese
      • Use Page Object Pattern
        • Tests do not interact directly with Selenium
  • 9. The Page Object Pattern
  • 10. Page Object Test Example
  • 11.  
  • 12.  
  • 13. Data Driving
  • 14. Using Build-Test-Data
  • 15. BDD Frameworks
  • 16. Selenium RC & Spock
  • 17. rfletcherEW adhockery.blogspot.com energizedwork.com github.com/robfletcher/grails-selenium-rc