Posts

Showing posts from May, 2012

System Testing Bookmarklets: Selenium

My switch search engine bookmarklet had two bugs. First when I deployed the page, the URL was screwed up (thanks for telling me Chris) and second my bookmarklet was incompatible with FireFox[1].   Conveniently the software engineering community has a solution to this class of problems and it's called  system testing. In this context, System testing means interact with the web pages via a browser just like users do.  I did some digging and I couldn't find a perfect (or awesome) tool for system testing web apps. I was able to get a tool that could drive FireFox and Chrome (IE isn't working).  This tool had some warts, and took some experimentation to get working, but it mostly meets the needs. Please comment if you find a better tool! The tool I used is called Selenium , and it's scriptable via python (also Java and C#). Selenium is able to impersonate a user performing actions via the common web browsers. The code below should make reasonable sense to someone fami

Assembly to JavaScript;TSRs to Bookmarklets

Image
Back when I started computing (the nineties), the coolest thing to to know was assembly. If you knew assembly you could make the computer do anything because the computer was essentially executing assembly[1]. Back in those days the way to inject code into the system was something called a Terminate And Stay Resident ( TSR ). This mini application could be invoked via a hotkey and run arbitrary code in your memory space - this was a great way to hack applications, or provide additional capabilities to programs. Luckily history repeats itself.  Today, assembly has been replace by JavaScript, and  the mechanism for  TSRs is called bookmarklets. Bookmarklets are book marks which execute arbitrary javascript code. To show you the power of bookmarklets I wrote a JavaScript bookmarklet that will take a search from  bing and run it on google or vice versa. You can install it by dragging  SwapSearchEngine  to your bookmark bar and then clicking on it.  I've embedded a vi

Soft Skills: Listen to people, and understand what they are telling you

( This post is not designed to be belittling, instead it's designed to be root cause analysis.) When Zach, my two year old, figures something out he screams out barely intelligible words and repeats them until I can figure out what he is saying and repeat it back to him.  The more non-obvious Zach's discovery the more insistent Zach will be that I understand his unintelligible statement. For example, the other day Zach and I were outside and Zach started screaming buddaf -  I was baffled! Zach was very insistent so I started looking around and sure enough I found a picture of a butterfly painted on a bus stop. I screamed butterfly, and Zach became ecstatic and we were able to move on to another topic. By contrast if I can't figure out what Zach is saying he gets sad, and acts rejected. This morning at breakfast Zach wanted something and I couldn't figure out what it was.  For 3 minutes Zach kept repeating masfd (which I still can't figure out) with vigour and