Tuesday, December 30, 2008

Special CodeMash Sessions And Labs Announced!

(Cross-posted on the CodeMash Google Group.)

I'm pleased to announce a great opportunity for learning about new technologies at CodeMash 2009:

Microsoft's Software + Services (S+S) and Development Platform Evangelism (DPE) teams have joined forces and will be using CodeMash 2009 to showcase some upcoming technology releases! CodeMash attendees will have a chance to learn about the just-announced Azure cloud computing platform, Visual Studio 2010, and the .NET 4.0 framework and languages.

Join the Microsoft team in the Banyan room, where you'll be able to work through a number of hands on labs hosted on 15 desktop workstations. MS team members will be manning the room throughout the entire conference and PreCompiler, waiting to help you learn about Azure, .NET 4.0, and the next release of Visual Studio (VS 2010).

Additionally, the Ironwood room will be set up as a lounge where you can relax and talk tech with other Microsofties. There will also be a few breakout sessions on Azure presented in Ironwood throughout the conference. Check your program guide and schedules posted outside the Ironwood room for more details.

This is a terrific addition to CodeMash 2009, and it was made possible  because of the passion, open-mindedness, and drive for learning that CodeMash attendees bring to the conference!

Monday, December 29, 2008

Book Review: Pragmatic Thinking & Learning

Pragmatic Thinking and Learning by Andy Hunt, ISBN 1934356050.

Yet another terrific book from Pragmatic Press, this one on the critical skill of learning how to learn.

It’s my opinion that problem solving and the ability to rapidly learn new things are the two most important skills in our industry. Andy’s book helps you boost your learning ability by walking you through some fundamental aspects of how one learns.  He uses a lot of practical examples drawn from various studies on the psychology and background of learning, and does a great job of linking findings in domains such as nursing to our own IT domain.

It would be easy to dive so deeply into complex, dry topics like the Dreyfus model of skill acquisition, brain modes, etc., but Andy does a great job of keeping an appropriate level of writing. He also fills the book with small, practical tips to help out – simple things like keeping a notepad or PDA around all the time to capture fleeting ideas in order to flesh them out later.

I also love how he highlights things that don’t work, like his example of “sheep dip” training where technologists are lined up and thrown through an intensive multi-day training course which has little or no direct applicability to their environment. The training, like the parasite-killing goop sheep are dipped in, quickly wears off and has to be re-applied.

The book’s tone is clear, enjoyable, and concise. The book’s content is invaluable and mind-changing. I highly recommend you grab a copy and read it!

Saturday, December 27, 2008

More Reasons to Love CodeMash: Cool Community Things

CodeMash is about community. It’s about passionate geeks from a bunch of different domains getting together and sharing a lot of ideas.

CodeMash is also about all the various cool things those fired up geeks do, like Steve Harman creating the @CodeMash twitter account to spread the news, or Maggie Longshore creating a GIF file of the CodeMash logo for folks to add to their Twitter images.

My favorite though (as of right now today, that is) is Joe Fiorini’s www.IsItCodeMashYet.com site.

I’d love to hear from you if CodeMash has inspired you to do something similar – and I don’t care how big or small it is!

Wednesday, December 10, 2008

Selenium XPath Fu: Clicking the Right Dynamically Generated Button

Problem: I'm writing a Selenium test that needs to click a button in a table row. Said table row has a title cell. Said row may not always be in the same position in the table, so I can't just hit it via absolute positioning with something like 'clickAndWait('//input[@value='Edit' and @type='button' and @onclick="window.location = '/CS/controlpanel/forums/SectionEdit.aspx?SectionID=35'"]);'

NOTE: All images below are links to full-sized ones.

I need to be able to find that title text, then hit the appropriate button and all this needs to happen dynamically.

Answer: First off, you need a couple extra tools to help you out. Grab the Firefox extensions XPath Checker and DOM Inspector. (Tools | Add-ons | Get Add-ons and search for those titles)

My goal is to use XPath to find find the table cell with the title text I'm interested in, then in that same row find the Edit button so I can click it. This way I'm not locked on to an absolute position in the table which will likely be wrong as I do my tests.

Navigate Firefox to the page you're working on testing. Open the DOM inspector (Tools | DOM Inspector or use Ctrl-Shift-I). In DOM Inspector select Search | Select Element By Click , switch back to your page and click the text you're interested in. In my case, DOM Inspector will now show something like this:

The cell's selected and the text of it shows in the right pane, but the button I want is actually an INPUT element further down the DOM -- that's the lower box. First we need to use XPath to grab the table row we want, then we'll work our way over to the button.

Flip back to Firefox and right-click by the cell you want and select View XPath from the context menu.

The XPath Checker window will open.

Note the XPath (id('Listing')/tbody/tr[3]/td[1]) is the absolute position format, which we don't want! However, we can see the element ID of the table is 'Listing' and we need that! Change the XPath in the field to "//table[@id='Listing']" and you'll see we've gotten the entire table. A good start.

Now remember that our title was in the text field of an <A> element (see the DOM Inspector above).  Edit the existing XPath to search for any <A> element in the table which has "My Test Table" as its text content: "//table[@id='Listing']//a[text()='My Test Forum']". Note how the display changes.

Important note: This assumes (bad word!) that only one <A> element has the text "My Test Forum."

Now we need to navigate over to the <INPUT> element holding the Edit button. We are in an <A> element in a <TD> of a <TR>. We need to go up a couple levels, then look for the Edit button. The XPath "parent" will help us. Edit the XPath to go to the parent <TD> element ("//table[@id='Listing']//a[text()='My Test Forum']/parent::td") and you'll see the display change.

Finish by going up another parent to the row and then looking for the INPUT element with a "value" of "Edit" ("//table[@id='Listing']//a[text()='My Test Forum']/parent::td/parent::tr//input [@value='Edit']") which will result in the following:

Voila! We've got our XPath correct!

Now paste that entire XPath into your Selenium IDE's test case's Target field. The command type should be "clickAndWait." Click the Find button and you'll see the Edit button on your target page flash green, signifying you've gotten it right! (If it doesn't flash green, then go back and fool around with your XPath in XPath Checker.)

One last step. Execute that command of the test case with right-click | Execute this command. You should see the command line shaded green, and the Firefox window in the back nav to the proper page.

 

Phew!

Monday, December 08, 2008

CodeMash Schedule is Live!

We’ve finalized the schedule for CodeMash 2009!  Check out the schedule on the CodeMash site!

What? You’ve still not registered for CodeMash? Go do it now, or I will taunt you some more.

Subscribe (RSS)

The Leadership Journey