Talking testing, agile and automation... and anything else.

Accessing Browser Objects Using Sahi

Sat, April 21st 2012 by

Sahi is a great automation tool for testing web applications. While Similar to Selenium, Sahi offers many notable advantages over Selenium, including some that were deal breakers in my current situation (IE support for instance).

Sahi also offers some ways to access page objects that are just flat out awesome. I’ll discuss a few here, specifically strings, indexes and it’s built-in Browser Accessor API _under.

Consider the following HTML table…

Last Name First Name
Deng Luol
Rose Derrick
Gibson Taj

Suppose you had a story that called for you to click a link from the table above. Simple enough… in Sahi you could write something like this:

Yup. This code does indeed open Lu’s Wikipedia page as expected. It’s using the link text to access the page’s object (not an xpath). Handy for sure but what if you had other sites to test that contained different data in this same table (hopefully not any Miami Heat Players)? Or maybe these links are commonly deleted by other scripts you’re running? The code above would fail.

No problem. Sahi indexes all page objects which allows you to access the “nth something” on the page. In this example, we could just click the first link. And in case there are other links elsewhere above, we’ll be more specific and make use of one of Sahi’s fantastic relational accessors, _under. So…

Lu’s Wikipedia page again appears! What’s happening here is we’re clicking the first link (indexes are zero-based a thus start with zero) under the table header “Last Name”. Thanks to the indexing of the links, we could also iterate through all of the links via a simple for loop.

But now maybe we’d like to take this up a notch and inject some randomness that will help broaden our testing scope and perhaps improve our chances of finding a bug (the purpose of testing after all). And maybe we’ll also make it a function to help keep our automation more readable. So perhaps something like…

This function uses Sahi’s _count method to count the number of cells that have an id of lastname. (Note: because the results of _count are NOT zero-based (starts with 1) it returns “3″ so we just subtract 1. We then use Sahi’s method _random to get a random number between 0 and $numPlayers (2). Now we call the same code as in our previous example to click one of the player’s links at random, under the table header “Last Name”.

And now any one of my Bulls player’s Wikipedia pages is displayed when running the script! These are just a few of the ways Sahi lets you get at page objects… there’s a bunch more including _leftOf and _rightOf, new to Sahi Pro 4.2.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Automation, Sahi, Testing, Tools | No Comments »

It Takes a Troop of Monkeys…

Thu, March 29th 2012 by

I doubt they think it takes a whole troop!In the recent uTest blog post, Gerald Weinberg hit an old nerve of mine…

“To me, the biggest weakness [in the way companies test software] is not considering software testing anything but a (barely) necessary evil. Testing is seen as something that could be done by a troop of monkeys, so serious testers are treated like third-class individuals. The lack of means of acquiring testing skills arises from this attitude, as do most of the other poor practices in the testing business. You treat people as if they are stupid, then they will wind up acting stupid.”

This truth is something that I’ve dealt with my entire career… and has been on my mind lately.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: QAisms, Testing | No Comments »

Can Not Reproduce

Tue, March 20th 2012 by

This is my favorite xkcd comic and one (arguably) appropriate for this site…

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Testing | No Comments »

Bret Victor – Inventing on Principle

Sun, March 11th 2012 by

I found this video via Slashdot and after watching it, read some of the comments… which hilariously missed the scope of the presentation. I post it here because it reminds me… that if you abolish boxes, there’s no need to think outside of them.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Inspirado, Videos | No Comments »

Testing James Bach

Thu, February 9th 2012 by

I’m watching a talk by James Bach (who can impressively talk over heavy nose-breathers) in which he claims he has a google alert for blogs with the terms exploratory testing. I am now testing this claim.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: QAisms, Testing | 1 Comment »

Screencasting With Jing

Sun, January 15th 2012 by

The folks at TechSmith make a nice screencasting tool called Jing that I’ve been using for quick tutorials and various documentation. It comes in two flavors, free and pro, but interestingly, I’ve found the free versions limitations to almost be features.

For example, it only records 5 minutes of video. Personally I find that tutorials longer than 5 minutes to be too long anyway. If you’re rambling on for longer than 5 minutes, your listeners are gonna move on.

Which brings me to another limit/feature… you can’t edit the video. I also like this because I want to make quick tutorials… not monkey around with video editing. This forces the issue.

The free version only records video to swf (pro version does mp4) which again, is kinda nice. You can drop the resulting swf onto any modern browser (with flash installed) and the video will play. No additional apps required. It’s also a *snap to embed in a web page (see below). Additionally, it runs on Mac & Windows, has nice stingers and can also do screengrabs with markup.

Now, that said, if you’re looking to build a slick, more professional screencast, Jing will fall short. It’s strengths are agility and functionality… pretty is another apps job.


*Update… okay, so there are some issues playing back swf files on windows :) Here’s a link to the video.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Tools, Videos | No Comments »

Context-Driven Software Testing (taking what the defense gives you)

Sat, January 14th 2012 by

I’ve never been one to dwell on QA-related terminology. I could care less about the differences between mauvebox testing and pucebox testing (I made these up, no need to google ‘em). I could see how such things would be useful in a conversation… but bringing them up can quickly turn that conversation into an argument. No thanks.

Still, the idea of context-driven testing just seems to describe the way I think about testing. If I was to describe it in basketball parlance (and I always do), it might be “take what the defense gives you”. For example, if they back off you and dare you to shoot it, shoot it!.

Or you can read this explanation (boringly devoid of basketball terminology) from James and Cem…

Context-driven testers choose their testing objectives, techniques, and deliverables (including test documentation) by looking first to the details of the specific situation, including the desires of the stakeholders who commissioned the testing. The essence of context-driven testing is project-appropriate application of skill and judgment.

Adjusting your testing to fit the current situation should seem like a no-brainer but it can be hard to stay true to. It’s easy to listen to, if not rely on, the ghosts of projects past. Context-driven testing might require you to get out of your comfort zone, learn new things and adapt to change but this also enforces another popular QAism: that software development is a creative, complex human activity… which it has proven itself to be… to me.

And as Kobe found out the hard way, my Bulls’ defense is almost universally ungiving.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: QAisms, Testing | No Comments »

The Power of UX (or Why I Switched to Chrome)

Mon, December 19th 2011 by

This past year, I switched the default browser on all my machines–Macs and PCs–from Safari, to Google’s Chrome. Ironically, the reason was because of UX (User Experience).

::SPOILER:: It was the URL bar.

Like most browsers up to that point, Safari had two forms in the bar; one for entering a URL and one for searching the web. Google melded these two into a single URL/Search bar (reminds me of a single button mouse), thus, when I open a new page, focus is in the bar and I can just start typing a search term or a url. Brilliant!

Safari and Chrome share the same engine, WebKit, so they’re very similar in speed and general abilities, which makes this coup even more impressive. They snuck inovation in to the very top of my browser workflow! Because this is what I end up doing most in a browser, once I got a taste, I was addicted and found myself typing searches into other browser’s url bars. I became annoyed with Safari’s antiquated two-form functionality, and eventually I moved on.

The irony of course, is that Apple has a history of being pretty good at UX… and I’m excited by the idea that more companies are making UX a priority. I wouldn’t say the torch has been passed… but rather, additional torches have been distributed.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Testing, UX | No Comments »

Testing In The Cloud

Sat, December 17th 2011 by

I’ve been watching some of the presentation videos from the 2011 Google Test Automation Conference (GTAC) and found this one to be particularly interesting. Entitled “Building a Test Grid for the Cloud”, Simon Stewart talks about writing tests, ensuring test isolation and testing in the cloud (including Amazon’s EC2).

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Automation, Presentations, Videos | No Comments »

Better Communication From A Distance

Fri, December 16th 2011 by

There’s an old joke in Bluegrass music circles that goes “Bluegrass musicians will drive hundreds of miles to jam with people from their home town”. It’s funny ’cause it’s true. While attending a ThoughtWorks workshop this past year, with a faction of my company’s QA team, I discovered this joke can also apply to software testers. Eg. it can take traveling hundreds of miles to get testers from the same company to work together.

At the workshop, it quickly became clear that many of the questions or pain-points expressed by individuals within our group, were at least shared by, and in many cases, could be solved by, other individuals from our group. With that powerful knowledge in hand, I paired up with a coworker to hatch a plan (over cocktails… ’cause we’re from Wisconsin) to leverage this shared knowledge and pain.

The plan was simple enough; set up bi-weekly QA meetings, at which a pair of testers would facilitate the meeting and make a presentation to the rest of the group. Fairly straight ahead but there’s some details to call out…

The meeting will:

  • Be one hour. Topics must be sized and focussed to fit.
  • Facilitated by a pair of testers. The idea being each will QA the other’s work, thus solidifying their concept and streamlining the meeting.
  • Be tool agnostic as possible (unless the a tool itself is being presented).
  • Include an example(s).
  • Attempt to ask and answer a question.
  • Concentrate on topics that affect the entire group. Questions will come up at the meetings themselves that can/should be tabled for a future meeting topic.

The overall premise for the meetings are for the presenters to “show their cards”, as it were. Show examples of what they are actually doing; not what some book says you should be doing. This is essental and it takes a lot of courage to expose yourselves in this way… especially to a room full of QA! I’ve found the fear/pain from such exposure can be lessened substantially by pairing facilitators and allowing them to come to a concusses before presenting. Strength in numbers! This has also proved to keep the conversations at the meetings focused.

We’ve been running these for a couple months now and the response has been extremely positive. I documented one of the topics from a meeting in a previous post… I’ll try to continue to do so.

Plusone Linkedin Facebook Twitter Digg Email
Filed under: Communication, Presentations | No Comments »
  • Buy Cheap comparison cialis levitra viagra Online Cheap Online Pharmacy. Best Internet.
  • Buy Cheap buy viagra prescription Now Top Online Pharmacy Supplier. Best Prices.
  • Buy Cheapest viagra tablet Now Free Viagra Pills! Cheap Pharmacy Online.
  • Buy Cheapest buy viagra canada Now Best Internet. Cheap Online Pharmacy.
  • effects side viagra Online Without Prescription Low Prices. WorldWide Shipping.
  • Buy Cheap cialis daily dosage Online Drugs, Health And Beauty. Best Internet.
  • Buy Cheapest cheapest place buy viagra online Online Internet Prices For cheapest place buy viagra online! Low Prices.
  • Buy Cheapest levitra discount Online Special Prices For levitra discount! Best Prices.
  • Buy Cheapest site viagra Now 24/Online Pharmacy. Top Online Pharmacy.
  • Buy Cheap buy cialis soft Now Buy Medications Online. Online Medical Shop.
  • Buy Cheap women and cialis Now Discount Online Pharmacy. Best Drugstore.
  • Buy Cheap buy taladafil viagra Online Best Online. Cheap Prescription Drugs.
  • Buy Cheap viagra overnight shipping fedex Now Best Internet. Online Prices For viagra overnight shipping fedex!
  • Buy Cheap bayer levitra Online 24/Online Pharmacy. WorldWide Shipping.
  • Buy Cheapest overnight cialis Now Low Prices. Discount Pharmacy Online.
  • Buy Cheap cialis generic overnight state united Online Pharmacy Store. Internet Prices For cialis generic overnight state united!
  • Buy Cheap viagra generic soft tab Now Guaranteed Shipping. Online Medical Shop.
  • Find The Latest News And Information About cialis for sale Pills Low Prices.
  • Buy Cheap is levitra as good as viagra Online Low Prices. Order Cheap Meds Without Rx.
  • Buy Cheap viagra no prior prescription Now Best Internet. Internet Prices For viagra no prior prescription!
  • Buy Cheapest cialis cod Online Low Prices. Discount Online Pharmacy.
  • Buy Cheap compare viagra prices Online Internet Prices For compare viagra prices! Best Online.
  • cialis prescription online Online Without Prescription Best Prices. Best Internet.
  • Buy Cheap buy viagra online cheap Online Best Drugstore. Discount Online Pharmacy.
  • Buy Cheap generic viagra free shipping Now No Prescription Needed. Free Viagra Pills!
  • Buy Cheapest buy tadalafil cialis Now Discount Online Pharmacy. Best Online.
  • Buy Cheap how does viagra work? Now WorldWide Shipping. Top Online Pharmacy.
  • Buying Cheapest buy genuine levitra online. Mexican Pharmacy, Best Prices. Best Online.
  • Buy Cheapest cialis levitra viagra compare Now Top Online Pharmacy. WorldWide Shipping.
  • Buy Cheapest generic cialis tadalafil 120 tabs Online Online Prices For generic cialis tadalafil 120 tabs! Best Online.
  • Buy levitra price comparison Without Prescription Doctor. Pharmacy At The Best Price!
  • Buy Cheap prescription online levitra cialis viagra Online Low Prices. Pharmacy At The Best Price!
  • Buy Cheapest cialis line order Now Free Viagra Pills! Cheap Online Pharmacy.
  • Buy Cheap order viagra air travel Now Top Online Pharmacy. 24/Online Pharmacy.
  • Buy Cheap viagra in manchester uk Now Best Internet. Discount Pharmacy Online.
  • Buy Cheapest low cost viagra online Now Cheap Pharmacy Online. Best Internet.
  • levitra online order Online Without Prescription Cheap Meds Without Prescription.
  • Buy Cheapest cheapest viagra in uk Online Best Drugstore. Cheap Pharmacy Online.
  • Buy Cheap information on levitra Now Online Medical Shop. Cheap Online Pharmacy.
  • Buy Cheapest online pharmacy generic cialis Online 24/Online Pharmacy. Best Online.
  • Buy Cheap what is levitra Online Best Online. Internet Prices For what is levitra!
  • Buy Cheapest cialis for free Online Guaranteed Shipping. Pharmacy Store.
  • Buy Cheapest buy levitra online Now Free Viagra Pills! WorldWide Shipping.
  • Buy Cheap cialis tablet size Now Pharmacy At The Best Price! Low Prices.
  • Buy Cheap viagra propecia Now Safe And Secure Payment System. Low Prices.
  • Buy Cheapest cialis testimonial Now The Largest Internet Pharmacy. Best Online.
  • Buy Cheap generic name for cialis Now Cheap Online Pharmacy. 24/Online Pharmacy.
  • Buy Cheap viagra cialis cheap Online Pharmacy Store. Online Prices For viagra cialis cheap!
  • Buy Cheapest woman use viagra Now Cheap Pharmacy Online. Guaranteed Shipping.
  • Buy Cheapest advantages of levitra Online Internet Prices For advantages of levitra! Best Prices.
  • Buy Cheapest cheapest viagra uk Now Pharmacy Store. 24/Online Pharmacy.
  • Buy Cheap viagra in manchester uk Online Cheap Online Pharmacy. Pharmacy Store.
  • Buying Cheapest buy australian viagra. Mexican Pharmacy, Best Prices. Best Online.
  • Buy Cheap cheapest cialis index Online Pharmacy Store. Cheap Prescription Drugs.
  • Buy Cheap viagra cialis canadian pharmacy Now WorldWide Shipping. Discount Pharmacy Online.
  • Buying Cheap viagra propecia celebrex. Offshore Rx, Good Prices. Top Online Pharmacy.
  • Buy levitra free samples Without Prescription Doctor. Best Prices. Best Internet.
  • Buy Cheapest buy online pharmacy viagra Online Drugs, Health And Beauty. Low Prices.
  • Buy Cheap levitra free sample Online Internet Prices For levitra free sample! Low Prices.
  • Buy Cheapest viagra levitra review Online Cheap Prescription Drugs. Best Internet.
  • Buy Cheapest levitra effect Online Best Online. No Prescription Needed.
  • Buy Cheap us levitra Online Best Drugstore. Buy Medications Online.
  • Buy Cheap generica cialis Now Bonus Pills And Reorder Discounts! Low Prices.
  • Buy Cheap levitra side effects Now Discount Online Pharmacy. Top Online Pharmacy.
  • Buy Cheapest cialis lowest price Online Best Online. Guaranteed Shipping.
  • Buy Cheapest woman taking viagra Online Cheap Pharmacy Online. Best Internet.
  • Buy Cheap generic cialis pill Online Best Drugstore. Online Prices For generic cialis pill!
  • Buy Cheapest buy levitra Now Guaranteed Shipping. Best Drugstore.
  • Buy Cheapest viagra propecia pain relief headache Online 24/Online Pharmacy. Best Prices.
  • Buy Cheapest 20mg cialis Online Low Prices. Special Prices For 20mg cialis!
  • Buy Cheap cialis pills Online Best Internet. Special Prices For cialis pills!
  • Buy Cheapest does cialis work Online Best Internet. Cheap Online Pharmacy.
  • Buy Cheap viagra generic soft tab Online Best Drugstore. 24/Online Pharmacy.
  • Buying Cheap order cialis online. Offshore Rx, Good Prices. Top Online Pharmacy.
  • Buy Cheap viagra substitutes Now Discount Pharmacy Online. Best Drugstore.
  • Buy Cheap levitra medication Online Drugs, Health And Beauty. Best Internet.
  • Buying Cheapest viagra prescription medication. Mexican Pharmacy, Best Prices. Best Online.
  • Buy Cheapest side effects of viagra Online Best Internet. WorldWide Shipping.
  • Buy Cheapest cialis in mexico Online Special Prices For cialis in mexico! Best Prices.
  • Buy Cheap cialis cheap no prescription Online Discount Pharmacy Online. Best Prices.
  • Buy Cheap viagra young Online Best Online. Cheap Prescription Drugs.
  • Buy Cheapest order cialis soft Online Best Internet. Top Online Pharmacy.
  • Buy Cheapest levitra price Online Online Medical Shop. Pharmacy Store.
  • Buy Cheap vicodin viagra cialis Now Free Viagra Pills! Online Medical Shop.
  • viagra online cheap Online Without Prescription Best Prices. WorldWide Shipping.
  • Buy Cheapest find cheap cialis Now Best Prices. Top Online Pharmacy Supplier.
  • Buy Cheap cialis online discount Online Free Viagra Pills! Online Medical Shop.
  • Buy Cheap buy cialis delived fed ex Online Order Cheap Meds Without Rx. Best Internet.
  • Buy Cheapest cialis shipping Now Free Viagra Pills! Top Online Pharmacy.
  • Buy Cheap professional viagra ceep Now Top Online Pharmacy. Online Medical Shop.
  • Buy Cheapest cialis testimonies Online Low Prices. Cheap Online Pharmacy.
  • Buy Cheapest buy generic cialis Now Pharmacy Store. Drugs, Health And Beauty.
  • Buy Cheap generic cialis fedex Online Cheap Pharmacy Online. Guaranteed Shipping.
  • Buy Cheapest information on viagra Now WorldWide Shipping. Guaranteed Shipping.
  • Buy Cheap levitra overdose Online Cheap Pharmacy Online. Pharmacy Store.
  • Buy Cheap levitra prescription drugs Now Pharmacy Store. Discount Online Pharmacy.
  • Buy Cheapest free levitra sample Now Best Online. Internet Prices For free levitra sample!
  • Buy Cheapest cialis testimonial Now Best Online. The Largest Internet Pharmacy.
  • Buy Cheap cialis soft tab india Now Drugs, Health And Beauty. Best Drugstore.
  • Buy Cheap levitra lowest price Online Cheap Prescription Drugs. Low Prices.