SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
How My Comic Book
Obsession Birthed a New
 Functional Testing Tool

            Feihong Hsu
Testing in Python Birds of a Feather
           March 12, 2011
I like comics
I like studying Chinese

  我喜欢学中文

  我喜歡學中文
These are two tastes that go
      great together!
Especially when
you find a real
gem like this:
Problem: Chinese comics portals load
slowly and have poor usability

Solution: Write a web scraping tool to
batch download images, so I can
be a proper Apple fanboy and read
comics on my iPad
First approach: urllib2 + lxml.html


Verdict: Total fail, couldn't handle
JavaScript and cookies
Second approach: XULRunner

Verdict: Asynchronous logic was
painful, Python integration would not
have been trivial
Third approach: spynner

Verdict: Not bad! But... some sites
don't load. Why?
Fourth approach: Make spynner
dumber

Verdict: Frickin' awesome
Coincidence: At Leapfrog, we needed
a better way to test JavaScript
behavior on our sites

Result: Leapfrog subsidizes my
comic book addiction
Over time, we added some nice stuff
to our spynner fork

- Ability to ignore SSL errors
- Form manipulation methods
- Screen capture (consistently-sized
images)
- Other stuff that I can't remember
Question: Hey Feihong, where can I get
this sexy library?

Answer: Nowhere, I'm too busy
reading comics to open source it
Real answer: We're working on
open sourcing it, but we ran into
some blocks

(Cast sidelong glance at Terry)
However, we are NOT
soliciting suggestions for a
    name. We have the
PERFECT name already.
PunkyBrowster
Some basic usage
from punky import Browster

browser = Browster(auto_load_images=True)
browser.create_webview(show=True)
browser.load('http://www.duckduckgo.com/')

browser.fill('input#hfih',
  'How do I de-pube-ify waterless urinals?')
browser.submit('form#hfh', wait_load=True)

for element in browser.all('#r12 > div'):
   print unicode(element.toPlainText())
Random note: I
never want to have
 the need to see a
  urologist. But if I
   do, I hope he's
  wearing a badge
      like this:
I am done

Weitere ähnliche Inhalte

Andere mochten auch

Definitions And Histories Of Comics
Definitions And Histories Of ComicsDefinitions And Histories Of Comics
Definitions And Histories Of Comicscharleshatfield
 
Comics Adaptations and True Believers
Comics Adaptations and True BelieversComics Adaptations and True Believers
Comics Adaptations and True BelieversDominican University
 
Overview of Approaches to Digital Composition
Overview of Approaches to Digital CompositionOverview of Approaches to Digital Composition
Overview of Approaches to Digital CompositionAmy Goodloe
 
See What I Mean: How to Communicate Ideas With Comics
See What I Mean: How to Communicate Ideas With ComicsSee What I Mean: How to Communicate Ideas With Comics
See What I Mean: How to Communicate Ideas With ComicsKevin Cheng
 

Andere mochten auch (9)

Definitions And Histories Of Comics
Definitions And Histories Of ComicsDefinitions And Histories Of Comics
Definitions And Histories Of Comics
 
L&R Lecture
L&R LectureL&R Lecture
L&R Lecture
 
Comics Adaptations and True Believers
Comics Adaptations and True BelieversComics Adaptations and True Believers
Comics Adaptations and True Believers
 
Overview of Approaches to Digital Composition
Overview of Approaches to Digital CompositionOverview of Approaches to Digital Composition
Overview of Approaches to Digital Composition
 
Comics as art
Comics as artComics as art
Comics as art
 
Online comics design
Online comics designOnline comics design
Online comics design
 
Comics, Arts and Crafts
Comics, Arts and CraftsComics, Arts and Crafts
Comics, Arts and Crafts
 
Comic Mangia
Comic MangiaComic Mangia
Comic Mangia
 
See What I Mean: How to Communicate Ideas With Comics
See What I Mean: How to Communicate Ideas With ComicsSee What I Mean: How to Communicate Ideas With Comics
See What I Mean: How to Communicate Ideas With Comics
 

Ähnlich wie How My Comic Book Obsession Birthed a New Functional Testing Tool

xkcd viewer report
xkcd viewer reportxkcd viewer report
xkcd viewer reportZx MYS
 
Evaluation of summer stop motion
Evaluation of summer stop motionEvaluation of summer stop motion
Evaluation of summer stop motionsophiecharles
 
How I got started in JavaScript
How I got started in JavaScriptHow I got started in JavaScript
How I got started in JavaScriptLim Chee Aun
 
Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.
Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.
Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.SANTIAGO PABLO ALBERTO
 
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...Tomomi Imura
 
Notice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical ContentNotice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical ContentTomomi Imura
 
Animation in the classroom
Animation in the classroomAnimation in the classroom
Animation in the classroomArtfulArtsyAmy
 
E4IT STARTER - MODULE 8.pdf
E4IT STARTER - MODULE 8.pdfE4IT STARTER - MODULE 8.pdf
E4IT STARTER - MODULE 8.pdfAnna Gandrabura
 
How To Pass A Ruby Code Test
How To Pass A Ruby Code TestHow To Pass A Ruby Code Test
How To Pass A Ruby Code TestRobert Postill
 
A tale of two proxies
A tale of two proxiesA tale of two proxies
A tale of two proxiesSensePost
 
Carrie casto’s learning styles
Carrie casto’s learning stylesCarrie casto’s learning styles
Carrie casto’s learning stylesccasto
 
Jakarta road blocks-challenges
Jakarta road blocks-challengesJakarta road blocks-challenges
Jakarta road blocks-challengesWill Kirkwood
 
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...Matt Raible
 
Visual Rhetoric March 25th
Visual Rhetoric March 25thVisual Rhetoric March 25th
Visual Rhetoric March 25thMiami University
 

Ähnlich wie How My Comic Book Obsession Birthed a New Functional Testing Tool (20)

xkcd viewer report
xkcd viewer reportxkcd viewer report
xkcd viewer report
 
Evaluation of summer stop motion
Evaluation of summer stop motionEvaluation of summer stop motion
Evaluation of summer stop motion
 
How I got started in JavaScript
How I got started in JavaScriptHow I got started in JavaScript
How I got started in JavaScript
 
Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.
Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.
Raspberry pi: Aprende raspberry pi con Linux por peter membrey y david hows.
 
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
[DevRelCon Tokyo 2017] Creative Technical Content for Better Developer Experi...
 
Notice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical ContentNotice Me, Senpai! Get Discovered with Creative Technical Content
Notice Me, Senpai! Get Discovered with Creative Technical Content
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Animation in the classroom
Animation in the classroomAnimation in the classroom
Animation in the classroom
 
E4IT STARTER - MODULE 8.pdf
E4IT STARTER - MODULE 8.pdfE4IT STARTER - MODULE 8.pdf
E4IT STARTER - MODULE 8.pdf
 
YUI The Elephant In The Room
YUI The Elephant In The RoomYUI The Elephant In The Room
YUI The Elephant In The Room
 
Learn to Code and Have Fun Doing It!
Learn to Code and Have Fun Doing It! Learn to Code and Have Fun Doing It!
Learn to Code and Have Fun Doing It!
 
How To Pass A Ruby Code Test
How To Pass A Ruby Code TestHow To Pass A Ruby Code Test
How To Pass A Ruby Code Test
 
A tale of two proxies
A tale of two proxiesA tale of two proxies
A tale of two proxies
 
Evaluation task 6
Evaluation task 6Evaluation task 6
Evaluation task 6
 
Carrie casto’s learning styles
Carrie casto’s learning stylesCarrie casto’s learning styles
Carrie casto’s learning styles
 
Jakarta road blocks-challenges
Jakarta road blocks-challengesJakarta road blocks-challenges
Jakarta road blocks-challenges
 
Unit 64 - Evaluation
Unit 64 - EvaluationUnit 64 - Evaluation
Unit 64 - Evaluation
 
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
 
Seven Reasons for Code Bloat
Seven Reasons for Code BloatSeven Reasons for Code Bloat
Seven Reasons for Code Bloat
 
Visual Rhetoric March 25th
Visual Rhetoric March 25thVisual Rhetoric March 25th
Visual Rhetoric March 25th
 

How My Comic Book Obsession Birthed a New Functional Testing Tool

  • 1. How My Comic Book Obsession Birthed a New Functional Testing Tool Feihong Hsu Testing in Python Birds of a Feather March 12, 2011
  • 3. I like studying Chinese 我喜欢学中文 我喜歡學中文
  • 4. These are two tastes that go great together!
  • 5. Especially when you find a real gem like this:
  • 6. Problem: Chinese comics portals load slowly and have poor usability Solution: Write a web scraping tool to batch download images, so I can be a proper Apple fanboy and read comics on my iPad
  • 7. First approach: urllib2 + lxml.html Verdict: Total fail, couldn't handle JavaScript and cookies
  • 8. Second approach: XULRunner Verdict: Asynchronous logic was painful, Python integration would not have been trivial
  • 9. Third approach: spynner Verdict: Not bad! But... some sites don't load. Why?
  • 10. Fourth approach: Make spynner dumber Verdict: Frickin' awesome
  • 11. Coincidence: At Leapfrog, we needed a better way to test JavaScript behavior on our sites Result: Leapfrog subsidizes my comic book addiction
  • 12. Over time, we added some nice stuff to our spynner fork - Ability to ignore SSL errors - Form manipulation methods - Screen capture (consistently-sized images) - Other stuff that I can't remember
  • 13. Question: Hey Feihong, where can I get this sexy library? Answer: Nowhere, I'm too busy reading comics to open source it
  • 14. Real answer: We're working on open sourcing it, but we ran into some blocks (Cast sidelong glance at Terry)
  • 15. However, we are NOT soliciting suggestions for a name. We have the PERFECT name already.
  • 18. from punky import Browster browser = Browster(auto_load_images=True) browser.create_webview(show=True) browser.load('http://www.duckduckgo.com/') browser.fill('input#hfih', 'How do I de-pube-ify waterless urinals?') browser.submit('form#hfh', wait_load=True) for element in browser.all('#r12 > div'): print unicode(element.toPlainText())
  • 19. Random note: I never want to have the need to see a urologist. But if I do, I hope he's wearing a badge like this: