Wednesday, February 13, 2008

Selenium IDE Flow Control - Goto and While Loops

tldr; https://github.com/73rhodes/sideflow

This extension provides goto, gotoIf and while loop functionality in Selenium IDE. Selenium IDE is a plugin for Firefox that automates the testing of web-based applications. There is an excellent flow-control extension at wiki.openqa.org/display/SEL/flowControl for the Selenium RC and TestRunner components, but it does not work with Selenium IDE (the Firefox plugin) directly. This makes it difficult to develop controlled test cases within Selenium IDE, and there are times when the frame-based TestRunner cannot be used (such as when the website under test employs a frame-buster script).

I've ported the existing control-flow extension to work in the Selenium IDE Firefox add-on. The image below shows a sample test case using goto, gotoIf and a while loop, all running successfully in Selenium IDE.



The file can be downloaded from Github and should be saved as "sideflow.js" to your hard drive. Then the Options settings in Selenium IDE should set the Selenium Core extensions to include the path of this file, similar to the image below.

I've published the extension on github.  Go ahead and download it from there. 


github.com/73rhodes/sideflow

Update 26 February, 2008:
This mod of the FlowControl extension works only with the Selenium IDE Firefox add-on. If you want to use the TestRunner component or Selenium RC, please use the original FlowControl extension.

Update 19 February 2011

I've moved the extension over to github. 


Update 7 July 2011
I've updated the example to use the newer syntax required in the latest versions of Selenium IDE.

Please note that if you are using Selenium RC, you should use the original flow-control plugin here: wiki.openqa.org/display/SEL/flowControl



Unfortunately I haven't had the time or the need to make this compatible with both Selenium RC and Selenium IDE.  Please feel free to fork the code on github and make a pull request if you would like to help out.

Update 24 July 2012
I added a "push" command to the plugin, with a simple example on the Github page. This allows you to easily create a collection of items and implement "for each"-style functionality to iterate over it. Here's the original announcement. 

Monday, February 11, 2008

Vis Duh

I haven't gone away, but my computer did, for a while. It was a bad stick of RAM. In the process of getting it back, I formatted my drive. Then I had to fork over cold hard cash for a new copy of Windoze XP. I got it only because the software I use for composing and recording music, Sonar, requires it.

I refuse to use Vista. Bill Gates was recently interviewed on Gizmodo and basically admitted that Vista was a failure. Voted one of the 10 Worst Tech Products of 2007 at Yahoo Tech, then as one of the worst tech products in history over at CNet UK. MicroSoft now has a class action lawsuit against them for their bungled "Vista Capable" PC sticker program where even a MicroSoft executive claimed he'd been burnt... suckered into buying "a $2100 email machine" that won't run any of Vista much-touted features.

If you want eye candy, you have a lot better options. You could get a Mac. Or, you can use one of many free Windows shell replacements, like LiteStep. Or if you find shell replacement a little daunting, there are several options for user-friendly Linux-based operating systems. Ubuntu is a really popular choice, and the new gOS looks really good, too. See www.thinkgos.com.

In fact, complete prepackaged eGos PCs are available for $199 at Walmart or possibly your local computer store.


Stunning 3D visual effects have been part of Beryl (now called Compiz Fusion) for a long time already. They don't even require fancy hardware and will run on systems several years old with minimal RAM.

I plan on never buying another operating system again. For a long time people have been waiting for Linux to mature to the point where it was nearly as user friendly as the commercial operating systems. Now MicroSoft has handed the open source community a huge advantage by releasing a product that is so much worse than the competition.

Thursday, January 17, 2008

Canada puts US on Torture Watchlist

CTV News has reported that the Canada has named the United States on a watch-list of countries with "greater risks of torture". The list is part of a workshop for Canadian diplomats meant to teach them to recognize signs of torture and places where it is more likely to be found. It specifically mentions "U.S. interrogation techniques" including "forced nudity, isolation and sleep deprivation". Presumably the document was compiled before the use of waterboarding in American interrogations became widely publicized (waterboarding has been declared illegal by the United States in the past and is an internationally recognized form of torture[1]).

Siting the list, a lawyer for a Canadian boy who has been illegally held and tortured at the infamous U.S Guantanamo Bay prison for five years claims that he should be returned to Canada for a court hearing. The lawyer said that the boy has been abused, that his rights have been violated under international law, and that Canada is not doing enough to help him.

And the lawyer making these incriminating statements is a Lieutenant Commander in the US military.

Monday, January 14, 2008

"We Own the World"


To follow the previous post, Noam Chomsky has written a new article, "We Own the World". It is excellent.

He explains clearly the intellectual and moral malaise that permeates current discussion of US policy towards Iran and the world in general.

Photo by John Soares, linked from www.chomsky.info

Sunday, January 13, 2008

Noam Chomsky on Iran

Noam Chomsky is a professor of linguistics and philosophy at the Massachusetts Institute of Technology. He has lectured and written extensively on US foreign policy and social issues. I've always been very interested in his perspectives, but until I saw this video, I'd found his other lectures somewhat dry. This interview does a good job of presenting an informed critique of the current political climate in the US regarding Iran in a concise and articulate manner. Noam Chomsky is a very respected voice, and what he says on Iran in this video is well worth hearing.

Saturday, January 12, 2008

Broken Voting

As a computer systems engineer, I've always thought electronic voting machines are a Bad Idea. Here is a video demonstration of a defect in the electronic voting machines being used in US elections.

Tuesday, January 8, 2008

The Not-So-Green Door

Today I ran into John Baird, Canadian Minister of the Environment, at The Green Door. Since John was standing right in front of me at the cash register, I asked him just to be sure, "Excuse me, are you the Minister of the Environment for Canada?"

And he said, "Yes, yes, I am... I'm a vegetarian, actually, but don't tell anyone!"

My first thought was, what an odd place to meet John Baird. The Green Door is basically packed on any night of the week with tree-hugging, veggie chomping, earth-loving activists. And Baird is most recently credited with playing a major role in removing any meaningful targets from the Bali climate change initiative. Against tradition, he barred opposition MPs from participating in the summit, and then even as reports of Canada's dismal environmental performance surfaced, he stood with the US and Japan in blockading the Bali agreement.

I said, "You know, I have to say I was pretty disappointed with Canada's showing at the Bali climate change summit."

"Oh, why is that?", he replied.

So I told him, from the reports I'd read, it seemed Canada played a major role in watering down many of the milestones that were meant to be included in the proposal.

He replied, "We can't keep doing the same things we've been doing for the last 60 years because they don't work," and stated that you can't have regulations that don't include some of the biggest emissions countries out there.

"Well," I told him, "my view on that, and one that seems to get a lot of agreement from many Canadians I talk to, is that Canada should do the right thing regardless of what China or India or other countries may or may not do. Canada should take a leadership role in setting an example for other countries to follow."

At this point John seemed a little annoyed, but guarded by a well-practiced veneer of professional courtesy. His reply didn't make a whole lot of sense to me: "If China has enough money to build up a huge military and throw journalists in jail, they have enough money to do something about the environment!" He reiterated that what we've been doing for the last 60 years wasn't going to work, and that carbon emissions were worse now than ever. I told him I was well aware of that. Nevertheless, I said, the comments from the New Guinea delegate resonated with many people.
"If for some reason you are not willing to lead, leave it to the rest of us. Please get out of the way."




After dinner, as I headed uptown for a coffee, I wondered why his parting remark didn't make much sense to me. China... lots of money... journalists... jail. What do any of those things have to do with Canadian environmental policy? How can we ignore the moral hypocrisy of pointing fingers at China while Canada effectively hobbles the effort to give real traction to the latest international environmental initiative? I decided his statement didn't make sense simply because it's not logical. He was probably in a rush, trying to grab a quick bite to eat, not in the mood to get questioned. But I had hoped for something a bit more tenable.

It would have been neat to find out more about John Baird's thinking on the environment and Canada's direction on environmental issues, his reasons for hamstringing Bali, and why his vague proposals for a yet-to-be-determined alternative are so much better... but he had taken his veggie plate to go, and made a beeline for the door.

"Keep up the good work," I said, with as much "veneer" as I could muster.

Perhaps instead of "I'm a vegetarian, actually... but don't tell anybody!" a more appropriate statement might have been, "I'm anti-Kyoto, anti-Bali, and anti-environment, actually... but don't tell anybody!"

Productivity and Note-taking

I told a friend of mine that I wasn't really happy with the amount of time that gets taken up by Slack and "communication and sched...