Monday, March 29, 2010

Selenesse dotnet is GO

Selenium + FitNesse = Selenesse

Chris McMahon and Marisa Seal took on a new project late last year, maintaining and extending some work that Gojko Adjic had done for FitNesse, called WebTest. They named it Selenesse. Selenesse combines the FitNesse wiki format and framework for defining and executing tests, with the UI browser driver, Selenium.

When I first found out they were doing this I thought it was neat and could use it myself. Since they work in the Java space and I work in the dotnet space, I decided that I could contribute to their project by doing a dotnet version, so that myself and others in the dotnet space could use it and extend it as they needed.

It was particularly interesting to me for a few reasons. I am a big fan of the wiki format for test writing and execution, first and foremost. I usually write my Selenium tests in a C# Nunit class, meaning that what the test is *doing* can be somewhat difficult to shake out (even with DSLs, we're still talking about code). Certainly, my developers can get through that, but nobody outside of this team can.

I am looking forward to involving my current team's business-facing people more in our software creation process. I believe that one step toward that is to work closely with them on defining what they want and at what point we can feel like those things are "done-done". I hope that by writing tests in a format that they can read, I can quickly walk through as many of the things that will represent "done-done" as we can -- and do that early and frequently.

So I took to writing the dotnet version of Selenesse. I struggled for a while and nearly gave up on it. The structure of what is being done basically looks like this:
Selenium RC dotnet client driver <-> SlimSeleniumDriver <-> FitNesse

I was able to call any method that existed in SlimSeleniumDriver, but not the native functions in the Selenium RC dotnet client driver. It was weird and frustrating, and no matter what I did or how I wrote it, I just couldn't get it to work.

Enter Mike Stockdale (@jediwhale) to the rescue! Mike has written fitSharp, another dotnet version of some FitNesse functionality. Selenesse dotnet uses fitSharp. It turned out, my code was just fine, but there was apparently some weirdness in file locations -- I placed the Runner.exe file in the same folder as my dlls and suddenly, it worked!

So, I introduce Selenesse dotnet. Click here to download all of the source (this will change as we get more organized). Go into the dotnet-selenesse folder and you will find the FitNesse wiki root and the src folders.

Not included in that package is the Selenium RC Server. I use Sauce RC (highly recommend it!!). To execute tests, the Selenium RC Server must be running.

I'll not get into more detailed instructions here -- look out for them in the download itself. There are instructions from Marisa and Chris's initial implementation in the wiki already. These will evolve over time. In the mean time, please feel free to contact me for help if you want to get set up and are confused or are having issues (setting up seems to always be difficult for me).

Sunday, March 21, 2010

What? A 12-year-old at Agile Coach Camp?


And it was amazing.

Why would I do such a thing as bring my 12-year-old to Agile Coach Camp?

Well, in all honesty, it was part laziness on my part at first. But it turned into so much more!

A colleague and friend, Catherine Louis, suggested to me 2 hours before registration started the first day (registration was 4pm on a Friday), that I go ahead and bring my 12-year-old to this first night of Agile Coach Camp. It was much more informal and social, she pointed out, and it would be easier for me. So I did.

He was a hit! He adds (usually, and here as well) a bit of humor to many things that I do. We went through a series of lightning talks on Friday evening that largely turned into individuals talking about their position papers and what they had hoped to get out of the weekend. I was triggered to get up and talk after a "development manager" spoke, since it was exactly that role I had come hoping to learn better techniques for dealing with. As I stood up talking, I said something along the lines of "If you know me, then you know I have a habit of being blunt and sometimes pissing people off." It became quickly apparent to me that my 12-year-old had done something funny, as the room erupted in laughter. (Yes, he had: he raised his hand in a "Yep, like me!" gesture).

As the group was breaking up for the evening, a few people approached us and asked Steven to return the next day.

My motivation for allowing him to come the second day was somewhat selfish (enabled by others asking for him to come back): I want for him to learn "how it's done" in the real world. I know that many of the topics are above his head (but what can the exposure hurt?). I want him to see the mechanics of people working together, thinking together, learning together and enjoying it, following their passions and communicating with respect and open minds.

Undoubtedly, he got all of that out of this weekend and more.

What I *wasn't* expecting was the impact *he* had on the other attendees! So many people approached me about his being present that it was almost overwhelming. He seems to have touched the hearts of a few people and inspired others. I saw someone (eek! What was his name, again?) else bring their daughter on Sunday! It was contagious ....

People *asked* for my 12-year-old to talk to the group as a whole. They encouraged him, they praised his behavior, his openness, and his "hacking" skills.

Driving home on Saturday evening, I got to listen to him describe how he felt less nervous after meeting all of those people, hearing what they said to him, and even talking in front of all of them. JACKPOT! What I was watching was a young adult gain a little bit of self-confidence.

I believe there is no greater gift.

Thank you, to all who attended Agile Coach Camp. I apologize if his presence was a negative experience for anyone.

Oh, and I am grateful to Mike Cottmeyer for walking with him down the path of "hack my iPod", a phrase I am certain to hear ad nauseam over the next few months.

You never get a second chance to make a first impression .... or do you?

I absolutely have to blog about this. For most people who attended Agile Coach Camp in Durham, NC this weekend, you are likely already somewhat familiar with this story, but I think there is a *really* valuable lesson worth sharing here.

I'm going to tell a story. When I have permission (assuming I get it), I will reveal the identity of the person in the story. I want to, if he'll let me, because I would like to be able to publicize what he's doing in the future.

At a conference last year, I had the opportunity to attend a TDD clinic. We were pairing in this clinic, and I ended up with two partners: someone I had never met or heard of -- let's call him Joe -- and someone I had really been wanting to meet -- let's call her Sarah. I found myself in a triangular-shaped pair, one of three very strong-willed people.

The experience was not a good one, for anyone involved. I'm not a developer anymore in my day job, and I only felt like I had so much authority. Both of my partners were developers, and I quickly found that Sarah and I had very similar ideas of what pairing should be like, but that was *very* different than how Joe paired. Sarah and I felt like our opinions were not being heard, and that Joe was trying very strongly to dictate to us exactly what should be done, down to exactly what words I should type. I can say that at one point, sitting in the middle of the two of them, I literally had Joe say "Type this" and Sarah say "No! Don't type that!"

Hopefully, I have gotten across that this was not a positive experience for any of the 3 of us. During a break, Sarah and I managed to find a friend -- let's call her Kathy -- and she agreed to come into the session and work with Joe, so that Sarah and I could work together in a way that was more comfortable for us. Certainly, this felt like the cowardly way of (not) dealing with the issue, and part of me wanted to address it directly, but I didn't get there.

In all honesty, I have not thought terribly much about this situation since that conference. I told the story to a few people at the conference, but not since. I had simply marked Joe off as someone I had a personality conflict with and would not want to work with.

So, why would I tell you today that Joe is now literally in my top 10 list of my absolutely favorite people? If given the opportunity, I will work with him in a heartbeat.

I believe that this example shows the power of an open mind, and the power of not judging people based on a single experience (obviously, this applies in both directions).

I arrived at Agile Coach Camp Friday night, registered, and made my rounds. Headed over to the bar, and who do I see? Well, there is Joe. At some point, I had seen his name on the roster and thought "this should be interesting, but I should be able to just avoid him". I don't think we were a whole 5 minutes into hanging out when the topic of our experience at the conference last year got brought up- by him. He set the tone flawlessly, by indicating that he knew me through a negative experience that had been traumatic, though largely his fault.

Let me just say, I really don't care to point fingers at or lay blame on anyone, so I do actually tend to struggle with someone who has just pointed a finger at themself.

He then put the ball in my court to describe the situation. I tried, as best I could to describe what had happened in a fairly diplomatic way, saying that we were in a situation where our different styles of pairing conflicted with each other. I did take my description a step farther, however, and described for the table how he had dictated to me exactly what to type.

So, here it was, this elephant was on the table, had been exposed, laid out bare. I was *incredibly* impressed with his humility. It really contradicted the arrogance I had seen in him last year. I appreciated that we both got to laugh about the experience. I learned a side that I had not known as well. I heard about how traumatic it had been for him (which also contradicts the arrogance I had seen), and the circumstances he was in at that time. I heard the stories that others had told him of what I had said. Honestly, I had no considered that it had upset him; he had seemed pretty oblivious to it at the time.

So I spent Friday, Saturday, and Sunday with an open mind. I watched him and interacted with him as if I had met him for the first time this weekend. The more I saw, the more I not only gained respect for him, but wanted to talk to him and share and learn from him.

I saw a person who is clearly fantastically passionate about what he is doing -- coding, refactoring, or teaching. I saw someone who has a wealth of knowledge to share, so much so that at times, you can almost watch it bubbling out of his ears. I saw someone who really *does* know what he is doing, inside, outside, and around. I got a taste of just how much I could learn, and just how parallel my passion and recent path is to many of the things that he has been doing as well. I bounced ideas off him for ways I can contribute to my community, and learned through discussions with him that things I thought I knew, I don't. He is aware of and describes his own weaknesses without hesitation.

In closing circle (this was an Open Space conference), we each talked about our experience at the camp. I sat in my seat, ready to describe the transformational experience to the group (by that point, a few people had heard the story). I was proud of myself for keeping an open mind and not letting the first experience cloud my view of him through the weekend. I was grateful that he did the same with me and was open to addressing the experience directly and had also been open to not judging me. I was grateful that I had not missed out on the opportunity to connect with another person in software who is clearly passionate, smart, and has a lot to offer. As I waited for my turn, he got up to tell the group about his experience this weekend.

Whaddya know, he told this whole story, in much the same way I have now. He said, "They say you never get a chance to make a first impression. Well, maybe sometimes, you do."

Joe, I look forward to working with you in the future and contributing to this community as a team.

Tuesday, March 16, 2010

How to handle the Windows Authentication pop-up with Selenium RC

For the first pass at this post, the scope is going to be pretty narrow. I'm going to try to use terminology that makes sense, but it may not be entirely accurate. I think that when I was trying to solve this problem, it's part of why I struggled.

I was working on a Selenium script for a newly built internal QA web site (yay!). When I go to this web site, however, before the web site loads at all, I get a little modal dialog box that asks me for authentication:

Well, Selenium has no capability for dealing with this box. I found, after much searching for terms like "selenium authentication", that putting the username and password into the URL was not going to help me. I have come to learn that that kind of authentication is called "HTTP authentication". If that's what you need, you should be able to solve it via this Selenium FAQ post: Selenium and Basic HTTP Authentication

I tried it, but it did not help.

It turns out, what my site was doing was a form of Windows-based authentication. And, as it turns out, it's not something Selenium can take care of at all. If hard-pressed, you can use something like AutoIT to script that part out. I don't yet need something that robust, so I decided to go with simpler solutions. I did find this great post from Atlassian blogs about writing a Selenium Container to deal with Windows Basic Authentication.

In any case, for the time being, I have created a Firefox profile just for use with Selenium, and then have told the Selenium server to use that profile, rather than creating a clean profile every time.

So how do ya do that?

Start by creating a Firefox profile. How to do that is actually pretty well documented here:

I should note here also that I have seen it recommended that whatever profile you create here should be in a different directory than the default profile directory that Mozilla uses. I did do that, for easy access, at the very least.

There's a really great blog post here, about some other profile configurations that can be made to optimize automated testing. There are some great settings in there that will save you heartache.

Once I created a profile that I intended to be used for Selenium, I started Firefox under that profile. In order to have the authentication dialog stop appearing, I had to go into the configuration for Firefox and tweak a few settings:

In the URL bar, type "about:config"

Tell it yes, you'll behave, and then you see a long list of configuration parameters. In the Filter box, type "ntlm".

You'll see 3 entries ... we care most about the "network.automatic-ntlm-auth.trusted-uris" one. In this one, type the server names that you want to stop this behavior on. For me, I just typed "qa1,localhost" ( is my test server).

The Atlassian post above indicates that you should also change the "network.ntlm.send-lm-response" to true, so feel free to do that, too (I didn't and it still worked for me, so ..... just try it and see what works?).

Then, you've got this profile ready to go. So the next thing is to tell the Selenium server to use that profile. When you start the Selenium server, pass it the following parameter:
-firefoxProfileTemplate "path-to-profile"

As a matter of preference, if you're not using Sauce RC, I'd highly recommend it. You can download it for free here: Sauce RC

It will run your selenium server for you, and has a convenient "Preferences" page where you can put in the parameters you need. If you're like me, you always end up getting stuck on some dumb syntactical issue and pulling your hair out. This saves my hair, and maybe yours, too.

For the record, I am aware that I didn't cover IE or Chrome, or any other browsers. It's just because I haven't gotten to them yet. I will post about it when I do. Also, I'd love to hear your feedback if you try it and work through any other details or complications. I'd like to make this post as robust as I can ...

Sunday, March 7, 2010

TEDx is awesome!

Oh boy! I have been missing out! I hope that I can make sure that other people I know don't miss out, too, by telling everyone who reads this about the TED conferences.

Just a few months ago, I learned about the TED conferences. I'm pretty sure I heard about it through a friend on Twitter who was going to one, and the more I looked into it, the more I loved the videos I found on the website. So, I started watching the videos, usually downloading them and sticking them onto my iPod to watch whenever. At some point, I found a few videos that I thought my son, Steven, would like. Turns out, he did: Gever Tulley, Sir Ken Robinson, etc.

So TEDx is just locally organized events carrying on the spirit of TED. I was so excited when I found out that there was one being organized locally. This one was called TEDxTriangleNC, and I am only sorry that I did not get involved in it sooner. It lived up to my expectations and then some.

I should say early that I brought my 12 year-old, Steven, with me. There's a story behind it, and if you want to hear it, just drop me a line, I'll be happy to tell it! I wasn't entirely sure of the speaker/topic list beforehand, but I wanted him to go to one of these inspiring and thought-provoking conferences. Steven was a hit, as basically the only young adult (I don't think I am allowed to call him a child any more!) in the audience. Zach Ward, the MC, caught on to him pretty quickly, and even had him read the lunch menu and acknowledgment.

The early set of talks on technology were particularly fun and relevant for me. Andy Hunt gave a great talk on sketching for mind mapping, basically. I hoped that it spoke to my 12 year-old, because he struggles with remembering stuff :) I was excited to see him talk because as a technical (and passionate!) tester, I certainly know his work, and knew he lives locally, but have never connected with him.

I have to say, though, I was on pins and needles, the hair standing up on the back of my neck, when one guy gave a talk titled, "Where are the fathers?" Here I sat in the audience, next to my 12 year-old son. A child who has basically never known his biological father, a statistic that I have fought since the day I found out that I, at the time a sophomore in college living with her parents, have fought since the day I found out I was pregnant. Here he presented a slew of statistics: most people in jail grew up in fatherless homes, most drug addicts grew up in fatherless homes, a dozen or more of these. "Where are the positive statistics?" I wondered, while I sat, watching my son intently. He later said it was his favorite talk because he could relate to it.

Hugh Hollowell, of Love Wins Ministries, gave a talk about the chronically homeless, and their lack of relationships, that both stuck with me and gave rise to many questions from me. Luckily, I had the opportunity to find him at the after-party and talk with him.

There was also a woman who read a poem she wrote after a horrifying near-car accident, where a car slid across the highway in front of her several times, with her own children and another's child in the car with her (geez, I can't remember her name!). David Beaver talked about the "Overview Effect", experienced by only those people who have the ability to see the Earth from space, and just how minimizing it is for their perspective of our day-to-day issues.

Funnily, I also got to connect with the group of people organizing the local Pecha Kucha night, here in Raleigh. It was great, because I had sent an email and volunteered mine and Steven's services for whatever they needed, and when one of the ladies heard me talking, she realized that I was the person she had been exchanging emails with! *THIS* is a *fantastic* group of people, and I am so excited to have met them, and I look forward to building relationships with them from here on out.

In short, I have decided that I absolutely LOVED TEDx because of this: it exposed me to people who are *passionate* about *something*, most of them involved in things other than software development. I love my software development community and connections there, both remotely and locally, but it was a really amazing experience to have a day to spend with other people who are just *passionate*. I feel like we run into many many people all the time who are just going through the motions, and I feel like finding others who have a passion and follow it is the exception, not the rule, unfortunately. At TEDx, I got to find a *bunch* of these people, and I am exceptionally grateful for that.

OH! I should mention one other thing .... in bringing the token young adult, I got connected with Ashley Cooper, who lives in Asheville, NC, but who is organizing a TEDx *youth* event out there. Of course, I gushed about what an awesome idea I thought that was, and just how much I loved that TED was reaching out to young adults. Before I knew it, she was introducing me to others as the "person who is organizing a local TEDx youth event here in Raleigh!" It makes me chuckle, but seriously, I am going to do that. I am scared out of my mind that I won't have what it takes to organize this, but I *so* want to see it happen. I really think that kids should be seeing these types of things and getting involved, and I look forward to being a part of that locally. If you want to help, *please*, *please* let me know ... I've got a couple of people who have volunteered, but will need plenty more.