JavaScript Testing VIA Selenium
Upcoming SlideShare
Loading in...5
×
 

JavaScript Testing VIA Selenium

on

  • 35,566 views

 

Statistics

Views

Total Views
35,566
Views on SlideShare
18,265
Embed Views
17,301

Actions

Likes
5
Downloads
78
Comments
0

19 Embeds 17,301

http://seleniumhq.wordpress.com 16788
http://feeds.feedburner.com 414
http://www.b12345.somee.com 20
http://127.0.0.1 17
http://webcache.googleusercontent.com 13
http://www.twylah.com 9
http://translate.googleusercontent.com 7
http://seleniumhq.wordpress.com HTTP 6
http://www.linkedin.com 4
http://worldofseleniumtesting.blogspot.in 4
http://www.scoop.it 3
http://worldofseleniumtesting.blogspot.co.uk 3
http://www.slideshare.net 3
http://worldofseleniumtesting.blogspot.com 3
http://twitter.com 2
http://seleniumhq.wordpress.com} {774458165|||pingback 2
http://192.168.1.101 1
https://www.linkedin.com 1
http://worldofseleniumtesting.blogspot.hu 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

JavaScript Testing VIA Selenium JavaScript Testing VIA Selenium Presentation Transcript

  • JS Testing VIA Selenium The good, the bad, the obvious. @admc
  • Do you have a beer?If you look at your hand, and it doesn’t have a beer...Thanks Yammer for hosting!This is going to be ninja fast and to the point.
  • Why? Again...Web Applications - getting bigger More complex More browsers and devicesClient side apps are built in JS Nothing new, still hard to test.
  • It’s better now than it was Selenium 1 selenium.getEval("this.browserbot.getCurrentWindow().docum ent.getElementById(‘mything’).click()"); - WTF Selenium 2 / WebDriver x.execute("window.location.href", function(o) { console.log(o) }) - WINNER
  • The Testable Bits You should have backend unit tests You should have web services tests You should have JavaScript Unit tests You should have JavaScript Functional tests You should have client side SE Tests
  • Testing Pyramid FTW. Start at the bottom.
  • JavaScript Testing Verifying DOM - verify attributes Firing Events - verify callback results Network Calls - verify mock callback results JavaScript Code - verify state
  • Using ExecuteJavaScript State selenium.execute(“window.myApp.mystate == true”)Network selenium.execute_async + foo unit or Mock.js, JSMock, etcEvents selenium.execute_async - Google it :) Some extra setup hereDOM assert selenium.execute(“$(‘#mydiv’).width == ‘50px’”)
  • Client Side Unit Tests Launch browser/environment Load up FooUnit, QUnit, Jasmine, or your “home brew” Selenium.execute to retrieve results Don’t worry, we are going to beat this horse to death!
  • My Selenium 2 VisionLaunch Browsers - FASTNavigate to pagesExecute JavaScriptAssert resultsDrink a beer.
  • SE 2 is Important The vision of a shared browser automation API Continuing to be more performant A community and dedication from Google Ongoing browser and version support - new releases
  • Tool ChainsThe power of SE 2Client side JavaScript Unit Test FrameworksRaw JavaScript access to the DOMCI SystemsAll things combined, we are captain tester!
  • Q&Ahttp://admc.iohttps://github.com/admc/@admc