Sitecore CMS and everything related RSS 2.0
 Friday, February 24, 2006
After another unfortunate accident at sdn, I had a strong desire to have at least a couple of simple tests to check that the sites are online and people can log in. With so many infrastructure changes it would hopefully help to reduce human element errors. Having the dense day schedule, it had to became a 'Thursday Night' project (thursay because I though of it at thursday and coudn't sleep until I try it)

Thanks to Scott Hanselman's blog, WATIR was the first thing that popped into my mind. WATIR stands for Web Application Testing in Ruby, and Ruby is being praised by its followers for elegance and joy most of all.

Cutting the long story short (it's actually a short story thanks to ruby) it worked out pretty well, and in a few hours I had tests that would check that

1. The homepage can be loaded and doesn't redirect anywhere else
2. It is possible to log in

WATIR uses Internet Explorer automation, so it will only work with IE available. Obviously it's not the tool of choice to have thorough UI tests, ensuring that everything works as it should in all browsers. However in my case, I think it does a great job with minimum effort.

[ruby source code]

Assuming that you have Ruby and Watir installed, you need to unzip it somewhere and start either cocrete tests (sdn5.rb, sdn4.rb..) or a complete suite (sdnSuite.rb). Double click the file and you should see IE window having its own life. Here's how the sdn5 test case looks like:

require 'Watir'
require 'SdnBase'
require 'test/unit'

class Sdn5 < SdnBase
   def setup
      super
      @homepage = "http://sdn5.sitecore.net/"
   end
 
   def test_homepage
      assert_homepage(/welcome/i)
   end
  
   def test_login
      go_homepage
      @browser.text_field(:id, /username/i).set(@username)
      @browser.text_field(:id, /password/i).set(@password)
      @browser.button(:name, /loginbutton/i).click
      assert(@browser.contains_text(/welcome ar@sitecore.net/i), "failed to log in")
   end
 end


Note that login tests will fail because I've removed my password in SdnBase.

Here's what will get you started:
1. Install Ruby for Windows. The simpliest way is Ruby one click installer
2. Install WATIR [http://wtr.rubyforge.org/]. Again, there's a windows installer available
3. Read WATIR user guide for starting steps
4. A great companion to WATIR would be either Firefox DOM explorer or IE web developer toolbar
[5]. If you want to get serious, Scott Hanselman has an NUnit-Watir integration guide

Another interesting thing to look at is Selenium:

"Selenium uses JavaScript and Iframes to embed a test automation engine in your browser. This technique should work with any JavaScript-enabled browser."

It supports xpath to access DOM elements, which is nice and familiar to Sitecore developers. I think it might even be reasonable to make Sitecore shell tests with something like that. It would definitely involve a combined effort, but might be worth looking at.

Friday, February 24, 2006 1:21:57 PM (FLE Standard Time, UTC+02:00)  #    Comments [3] -
Ruby | Sitecore | QA
Tracked by:
"http://morningside.edu/mics/_notes/pages/prilosec/index.html" (http://morningsi... [Pingback]
"http://morningside.edu/mics/_notes/pages/lipitor/index.html" (http://morningsid... [Pingback]
"http://blastpr.com/wiki/js/pages/ultram/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://blastpr.com/wiki/js/pages/melatonin/index.html" (http://blastpr.com/wiki... [Pingback]
"http://blastpr.com/wiki/js/pages/celebrex/index.html" (http://blastpr.com/wiki/... [Pingback]
"http://morningside.edu/mics/_notes/pages/celebrex/index.html" (http://morningsi... [Pingback]
"http://morningside.edu/mics/_notes/pages/rainbow-brite/index.html" (http://morn... [Pingback]
"http://morningside.edu/mics/_notes/pages/paxil/index.html" (http://morningside.... [Pingback]
"http://morningside.edu/mics/_notes/pages/ultram/index.html" (http://morningside... [Pingback]
"http://morningside.edu/mics/_notes/pages/coumadin/index.html" (http://morningsi... [Pingback]
"http://blastpr.com/wiki/js/pages/nexium/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://morningside.edu/mics/_notes/pages/effexor/index.html" (http://morningsid... [Pingback]
"http://blastpr.com/wiki/js/pages/zoloft/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://morningside.edu/mics/_notes/pages/nexium/index.html" (http://morningside... [Pingback]
"http://morningside.edu/mics/_notes/pages/lexapro/index.html" (http://morningsid... [Pingback]
"http://morningside.edu/mics/_notes/pages/clomid/index.html" (http://morningside... [Pingback]
"http://morningside.edu/mics/_notes/pages/soma/index.html" (http://morningside.e... [Pingback]
"http://morningside.edu/mics/_notes/pages/cialis/index.html" (http://morningside... [Pingback]
"http://blastpr.com/wiki/js/pages/prilosec/index.html" (http://blastpr.com/wiki/... [Pingback]
"http://blastpr.com/wiki/js/pages/prozac/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://blastpr.com/wiki/js/pages/soma/index.html" (http://blastpr.com/wiki/js/p... [Pingback]
"http://blastpr.com/wiki/js/pages/claritin/index.html" (http://blastpr.com/wiki/... [Pingback]
"http://blastpr.com/wiki/js/pages/viagra/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://blastpr.com/wiki/js/pages/celexa/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://blastpr.com/wiki/js/pages/clomid/index.html" (http://blastpr.com/wiki/js... [Pingback]
"http://morningside.edu/mics/_notes/pages/tramadol/index.html" (http://morningsi... [Pingback]
"http://morningside.edu/mics/_notes/pages/celexa/index.html" (http://morningside... [Pingback]
"http://morningside.edu/mics/_notes/pages/accutane/index.html" (http://morningsi... [Pingback]
"http://morningside.edu/mics/_notes/pages/synthroid/index.html" (http://mornings... [Pingback]
"http://morningside.edu/mics/_notes/pages/wellbutrin/index.html" (http://morning... [Pingback]
"http://blastpr.com/wiki/js/pages/tramadol/index.html" (http://blastpr.com/wiki/... [Pingback]
"http://morningside.edu/mics/_notes/pages/melatonin/index.html" (http://mornings... [Pingback]
"http://morningside.edu/mics/_notes/pages/cymbalta/index.html" (http://morningsi... [Pingback]
"http://promocija.com.hr/promocija.com.hr/includes/js/docs/48335156/index.html" ... [Pingback]
"http://entartistes.ca/images/images/docs/81367526/index.html" (http://entartist... [Pingback]
"http://split-dalmatia.com/split-dalmatia.com/images/docs/73811526/index.html" (... [Pingback]
"http://coolioness.com/attachments/docs/58150246/index.html" (http://coolioness.... [Pingback]
"http://blog.netmedia.hr/wp-includes/js/docs/84238305/index.html" (http://blog.n... [Pingback]
"http://realestate.hr/templates/css/docs/28593877/index.html" (http://realestate... [Pingback]
"http://thebix.com/includes/compat/docs/51589391/index.html" (http://thebix.com/... [Pingback]
"http://blog.netmedia.hr/wp-includes/js/docs/91708760/index.html" (http://blog.n... [Pingback]
"http://temerav.com/images/menu/91084644/index.html" (http://temerav.com/images/... [Pingback]
"http://temerav.com/images/menu/96509501/index.html" (http://temerav.com/images/... [Pingback]
"http://islands-croatia.comislands-croatia.com/includes/js/docs/54089144/index.h... [Pingback]
"http://discussgod.com/cpstyles/docs/62161481/index.html" (http://discussgod.com... [Pingback]
"http://jivest2006.com/docs/40579018/index.html" (http://jivest2006.com/docs/405... [Pingback]
"http://thebix.com/includes/compat/docs/10152421/index.html" (http://thebix.com/... [Pingback]
"http://thejohnslater.com/pix/img/docs/56008043/index.html" (http://thejohnslate... [Pingback]
"http://pspdesktops.com/fileupload/store/docs/18769945/index.html" (http://pspde... [Pingback]
"http://swellhead.netswellhead.net/docs/84545083/index.html" (http://swellhead.n... [Pingback]
"http://islands-croatia.comislands-croatia.com/includes/js/docs/68291686/index.h... [Pingback]
"http://legambitdufou.org/Library/docs/38152786/index.html" (http://legambitdufo... [Pingback]
"http://swellhead.netswellhead.net/docs/79619129/index.html" (http://swellhead.n... [Pingback]
"http://martinrozon.com/images/photos/docs/75270452/index.html" (http://martinro... [Pingback]
"http://realestate.hr/templates/css/docs/71546796/index.html" (http://realestate... [Pingback]
"http://ipsilon.hr/ipsilon.hr/cms/4/lib/docs/55227677/index.html" (http://ipsilo... [Pingback]
"http://vladan.strigo.net/wp-includes/js/docs/86309858/index.html" (http://vlada... [Pingback]
"http://realestate.hr/templates/css/docs/36157459/index.html" (http://realestate... [Pingback]
"http://islands-croatia.comislands-croatia.com/includes/js/docs/06712704/index.h... [Pingback]
"http://slaterjohn.com/downloads/2col/66689432/index.html" (http://slaterjohn.co... [Pingback]
"http://coolioness.com/attachments/docs/60340594/index.html" (http://coolioness.... [Pingback]
"http://pspdesktops.com/fileupload/store/docs/04061117/index.html" (http://pspde... [Pingback]
"http://martinrozon.com/images/photos/docs/43274485/index.html" (http://martinro... [Pingback]
"http://entartistes.ca/images/images/docs/65934120/index.html" (http://entartist... [Pingback]
"http://thejohnslater.com/pix/img/docs/42082955/index.html" (http://thejohnslate... [Pingback]
"http://ncdtnanotechportal.info/generator/docs/87198700/index.html" (http://ncdt... [Pingback]
"http://pddownloads.com/docs/08296030/index.html" (http://pddownloads.com/docs/0... [Pingback]
"http://vladan.strigo.net/wp-includes/js/docs/09763218/index.html" (http://vlada... [Pingback]
"http://promocija.com.hr/promocija.com.hr/includes/js/docs/52060005/index.html" ... [Pingback]
"http://plantmol.com/docs/80639343/index.html" (http://plantmol.com/docs/8063934... [Pingback]
"http://blog.netmedia.hr/wp-includes/js/docs/08493171/index.html" (http://blog.n... [Pingback]
"http://lecouac.org/ecrire/lang/docs/49649526/index.html" (http://lecouac.org/ec... [Pingback]
"http://islands-croatia.comislands-croatia.com/includes/js/docs/87090382/index.h... [Pingback]
"http://allfreefilms.com/wp-includes/js/25891222/index.html" (http://allfreefilm... [Pingback]
"http://promocija.com.hr/promocija.com.hr/includes/js/docs/70471394/index.html" ... [Pingback]
"http://lecouac.org/ecrire/lang/docs/25282359/index.html" (http://lecouac.org/ec... [Pingback]
"http://split-dalmatia.com/split-dalmatia.com/images/docs/84431573/index.html" (... [Pingback]
"http://thejohnslater.com/pix/img/docs/73486930/index.html" (http://thejohnslate... [Pingback]
"http://pddownloads.com/docs/66275653/index.html" (http://pddownloads.com/docs/6... [Pingback]
"http://seo4u.at/images/docs/68897595/index.html" (http://seo4u.at/images/docs/6... [Pingback]
"http://sevainc.com/bad_denise/img/8/paxil/" (http://sevainc.com/bad_denise/img/... [Pingback]
"http://easytravelcanada.info/js/pages/1/accutane/" (http://easytravelcanada.inf... [Pingback]
"abaffy.org/la/img/cialis/" (abaffy.org/la/img/cialis/) [Pingback]
"http://inatelevizia.sk/ad/img/viagra/" (http://inatelevizia.sk/ad/img/viagra/) [Pingback]
"http://easymexico.info/images/img/cialis/" (http://easymexico.info/images/img/c... [Pingback]
"http://easytravelcanada.info/js/pages/12/wellbutrin/" (http://easytravelcanada.... [Pingback]
"http://sevainc.com/bad_denise/img/10/soma/" (http://sevainc.com/bad_denise/img/... [Pingback]
"http://birds.sk/img/viagra/" (http://birds.sk/img/viagra/) [Pingback]
"http://ina-tv.sk/img/viagra/" (http://ina-tv.sk/img/viagra/) [Pingback]
"http://abaffydesign.com/la/img/cialis/" (http://abaffydesign.com/la/img/cialis/... [Pingback]
"http://sevainc.com/bad_denise/img/9/rainbow-brite/" (http://sevainc.com/bad_den... [Pingback]
"http://sevainc.com/bad_denise/img/3/clomid/" (http://sevainc.com/bad_denise/img... [Pingback]
"http://sevainc.com/bad_denise/img/1/accutane/" (http://sevainc.com/bad_denise/i... [Pingback]
"http://easytravelcanada.info/js/pages/4/cymbalta/" (http://easytravelcanada.inf... [Pingback]
"http://easytravelcanada.info/js/pages/3/claritin/" (http://easytravelcanada.inf... [Pingback]
"http://easytravelcanada.info/js/pages/2/celexa/" (http://easytravelcanada.info/... [Pingback]
"http://easytravelcanada.info/js/pages/11/ultram/" (http://easytravelcanada.info... [Pingback]
"http://sevainc.com/bad_denise/img/6/lexapro/" (http://sevainc.com/bad_denise/im... [Pingback]
"http://easytravelcanada.info/js/pages/9/prozac/" (http://easytravelcanada.info/... [Pingback]
"http://easytravelcanada.info/js/pages/3/clomid/" (http://easytravelcanada.info/... [Pingback]
"http://easytravelcanada.info/js/pages/2/cialis/" (http://easytravelcanada.info/... [Pingback]
"http://easytravelcanada.info/js/pages/1/celebrex/" (http://easytravelcanada.inf... [Pingback]
"http://easytravelcanada.info/js/pages/6/lipitor/" (http://easytravelcanada.info... [Pingback]
"http://easytravelcanada.info/js/pages/5/hoodia/" (http://easytravelcanada.info/... [Pingback]
"http://sevainc.com/bad_denise/img/2/cialis/" (http://sevainc.com/bad_denise/img... [Pingback]
"http://easytravelcanada.info/js/pages/12/viagra/" (http://easytravelcanada.info... [Pingback]
"http://sevainc.com/bad_denise/img/7/melatonin/" (http://sevainc.com/bad_denise/... [Pingback]
"http://sevainc.com/bad_denise/img/11/ultram/" (http://sevainc.com/bad_denise/im... [Pingback]
"http://sevainc.com/bad_denise/img/4/coumadin/" (http://sevainc.com/bad_denise/i... [Pingback]
"http://easytravelcanada.info/js/pages/9/rainbow-brite/" (http://easytravelcanad... [Pingback]
"http://sevainc.com/bad_denise/img/7/nexium/" (http://sevainc.com/bad_denise/img... [Pingback]
"http://adventure-traveling.com/images/img/viagra/" (http://adventure-traveling.... [Pingback]
"http://sevainc.com/bad_denise/img/11/tramadol/" (http://sevainc.com/bad_denise/... [Pingback]
"http://odin.net/images/pages/52807681/men-women-having-sex-together.html" (http... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/collin-farrell-sex-tape.ht... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/barbue-girl.html" (http:/... [Pingback]
"http://odin.net/images/pages/52807681/index.html" (http://odin.net/images/pages... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/how-do-teen-girls-masturb... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/mature-whore-fisting.html"... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/agent-scully-alien-fuck.h... [Pingback]
"http://odin.net/images/pages/35694472/celeb-up-skirts.html" (http://odin.net/im... [Pingback]
"http://odin.net/images/pages/52807681/erotic-slavery-stories.html" (http://odin... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/image-uploading-adult.htm... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/99493954/black-gay-video-produtions... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/teen-trends-courtney-doll.... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/free-xxx-video-pics.html"... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/sparkle-sweater-girls.html... [Pingback]
"http://odin.net/images/pages/35694472/hot-mom-pics.html" (http://odin.net/image... [Pingback]
"http://odin.net/images/pages/35694472/kate-winslet-nude-scenes-in-jude.html" (h... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/99493954/pussy-licking-techniques.h... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/la-blue-girl-free-downloa... [Pingback]
"http://odin.net/images/pages/52807681/hot-girls-squeeze-boobs.html" (http://odi... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/mother-and-daugther-sex-s... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/teenage-girl-nude.html" (... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/celebrities-sexy-pictures... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/porn-star-brooke-banner.h... [Pingback]
"http://odin.net/images/pages/35694472/xxx-schoolgirls-hardcore-pictures.html" (... [Pingback]
"http://odin.net/images/pages/52807681/bollywood-actress-in-bikini-bra.html" (ht... [Pingback]
"http://odin.net/images/pages/52807681/free-online-porn-samples.html" (http://od... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/teen-doggystyle-fucking-f... [Pingback]
"http://odin.net/images/pages/52807681/all-fours-thumbnail-naked-girl.html" (htt... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/xpress-train-hentai-movie.... [Pingback]
"http://odin.net/images/pages/35694472/janet-jackson-bikini.html" (http://odin.n... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/vip-adult-clubs.html" (htt... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/99493954/erotic-literature-for-wome... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/xxx-hardcore-she-males.ht... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/99493954/federal-judge-sex-scandal-... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/sexual-xxx-stories.html" (... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/caught-masturbating.html" ... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/my-little-girl-song.html"... [Pingback]
"http://odin.net/images/pages/35694472/thumbs-of-squirting-babes.html" (http://o... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/virgin-vagina-pic.html" (... [Pingback]
"http://odin.net/images/pages/35694472/stories-housewives-seducing-husbands-frie... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/a1-thumbnails-posts.html" ... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/32162341/i-need-free-party-ideas-fo... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/99493954/young-girls-sex-video.html... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/undergroung-teen.html" (h... [Pingback]
"http://odin.net/images/pages/35694472/cartoon-penis.html" (http://odin.net/imag... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/35807953/blonde-sluts-cocksucking.... [Pingback]
"http://odin.net/images/pages/35694472/art-bdsm.html" (http://odin.net/images/pa... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/access-to-sex-web-sites.h... [Pingback]
"http://odin.net/images/pages/52807681/st-johns-adult-attractions.html" (http://... [Pingback]
"http://cidesi.com/images/metro/metro2/pages/99493954/cheerleader-erotic-stories... [Pingback]
"http://gatewayplayhouse.com/photos/cai/pages/53348735/xxx-pictures-of-celebrity... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-viagra-online.html" ... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-ambien-online.html" ... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-valium-online.html" ... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-cialis-online.html" ... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-hydrocodone-online.h... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-vicodin-online.html"... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-phentermine-online.h... [Pingback]
"http://www.signalprocessingsociety.org/community/forum/buy-tramadol-online.html... [Pingback]
Tuesday, March 28, 2006 8:04:02 AM (FLE Standard Time, UTC+02:00)
There is also SWExplorerAutomation (http://www.webunittesting.com)
The program creates an automation API for any Web application which
uses HTML and DHTML and works with Microsoft Internet Explorer. The Web
application becomes programmatically accessible from any .NET language.

SWEA API provides access to Web application controls and content. The
API is generated using SWEA Visual Designer. SWEA Visual Designer helps
create programmable objects from Web page content.
Thursday, March 30, 2006 4:17:40 PM (FLE Standard Time, UTC+02:00)
There are now extensions to watir committed to the source (though not available as an official release) that support XPath addressing of elements as well as add support for FireFox (i.e. a watir script can now drive FireFox the same way it can I.E.).
Watir User
Friday, March 31, 2006 8:47:21 AM (FLE Standard Time, UTC+02:00)
Thanks.

I've heard on one of the Hanselminutes that Firewatir is coming, and I'm dying to try that.

Does it support the same contract as IE browser object, so that you only need to instantiate a different object and have your old scripts run on Firefox as well as IE?
Comments are closed.
Archive
<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
Blogroll
 Alex de Groot
Few words about SiteCore from Holland
 Alexander Shyba
Sitecore Support
 Anders Dreyer
Anders Dreyer on Sitecore Development
 Jakob Christensen
Sitecore Core Development
 Lars Fløe Nielsen
Lars's ramblings about development and business processes
 Ole Thrane
Sitecore API
 Runi Thomsen
Runi Thomsen Sitecore Toughts
 The Sitecore Experience
The Sitecore Experience
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Alexey Rusakov
Sign In
Statistics
Total Posts: 199
This Year: 49
This Month: 3
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2008, Alexey Rusakov
DasBlog theme 'Business' created by Christoph De Baene (delarou)