Saturday, September 17, 2011

Windows 8

Some days keeping up with new technology can be dangerous.  Today, I'm happy to say that I'm playing with the latest technology and it's absolutely safe without tying up another machine.

Step 1:  Install Oracle's Virtual Box http://www.virtualbox.org/
Step 2: Download Windows 8 Developer Preview http://msdn.microsoft.com/en-us/windows/apps/br229516
Step 3: Install according to the directions http://www.sysprobs.com/guide-install-windows-8-virtualbox
Step 4: Enjoy the next Windows without risking your existing installation.

Sunday, April 10, 2011

Generating c# scripts for Selenium 2.0 from the 1.0.10 Selenium IDE

For more information about why Selenium is now my favorite testing tool listen to this episode of Hanselminutes.

Anyway, I spent days looking for a WebDriver formatter for C# for the Selenium IDE.

Why, you might ask, do I want such a thing? Well, I don't need to set up and run the full Selenium server and client. I can test my ASP.Net applications directly from NUnit, thanks to the new WebDriver interface that has been added to the Selenium 2.0 beta.

When I couldn't find a formatter for the IDE, I started to write my own. As I was doing my research I found a "magical" class call WebDriverBackedSelenium. Hmmm, could this be something useful?

It turns out that not only was it useful, it was what I'd been looking for.

10 minutes later and I was in business.

Here's what you need to do to migrate your generated scripts from Se 1.0 to Se 2.0.

1. Download the Selenium Client Drivers for c# (Selenium WebDriver) from http://SeleniumHQ.org/download/.
2. Extract the drivers to an appropriate directory.
3. Follow the directions at http://seleniumhq.org/docs/appendix_installing_dotnet_driver_client.html with one exception. Include ALL of the .dlls that are in the driver directory.
4. Download and install NUnit http://www.nunit.org/?p=download (I've tested to 2.5.9)
5. Add a reference to the NUnit dll to your project
6. From the Selenium IDE, record your test. Click on the source tab. Select Options-->Format-->C# (Remote Control)
7. Copy the generated code and paste it into your test project.
8. Modify the code as follows
a. Add
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;
after
using Selenium;


b. replace
private ISelenium selenium;

with
private IWebDriver driver = new FirefoxDriver();
private Selenium.WebDriverBackedSelenium selenium = null;

c. In the SetupTest method, replace
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://..../");

with
selenium = new WebDriverBackedSelenium(driver, "http://..../");

9. Compile and run through NUnit

Sunday, March 6, 2011

Voice-Over Microphone Choices

I'm starting to create short videos to help users with an application I'm working on. They will be screen-casts with some voice over. (I've found that some people listen better than they read).

In the quest to record audio that is more helpful than distracting, I've realized that my microphone needs to be upgraded. My choices are theAudio-Technica AT2020 USB Condenser USB Microphone, the Samson CO1U USB Condenser Microphone, and the Nady Ultra Dynamic USB Microphone to Computer - USB-1C.

I've checked out numerous sources for reviews and I've found out a few things. Most amateurs doing reviews don't know how to use a side address microphone. Most professionals will throw away the stands the mics come with (or never take it out of the box).

Samson offers the C01U in a kit that includes a good desktop stand, a spider mount, the microphone, and a hard-side carrying case.

--EDIT--
Now the Audio Technica ATR2500-USB Cardioid Dynamic USB Microphone is available and calling my name.  More to follow.

 

Saturday, October 2, 2010

Gotta keep up

I'm in the process of migrating from NAnt to do my builds to PSake. I'd integrated PowerShell 1.0 into an application in the past and wanted to integrate PS 2.0 into my build application.

I pulled out my old code and started to implement it for PS 2.0, but figured I'd check for any comments on the 'Net. You know, warnings, gotchas etc. Any way, I found out that PS 2.0 is much easier to integrate into a .Net application.

Here and here

I hadn't looked into this type of thing in years. They've made it so much easier. Now if they'd make it easier to add the required reference. (Check out the first link for the "recommended" way to add the reference)

Sunday, September 26, 2010

Wild Six Months

Wow six months between posts! It's been wild. I was on a small team that worked on a project that will allow my company to change the way it does business. (I can't say more than that right now.)

While that was going on, we were also maintaining several other systems and dealing with new legal regulations facing the intermodal industry. Writing during that time, consisted of specifications and management reports. Any blog entries would have been filled with frustration.

Over the next several weeks, I'll be writing about some of the exciting challenges and lessons I learned.

1. Subversion doesn't work well with 5 developers working on the same piece of code.
2. "Complete" requirements aren't.
3. Separating the business layer and presentation layer really is a good idea.
4. Buggy code in the hands of a user is a good thing!

Tuesday, March 16, 2010

Bummer

http://www.inc.com/magazine/20100301/lets-take-this-offline.html

Between his blog and the StackOverflow podcast, I've learned so much about having the right attitude!

Skill takes you just so far and then you have to learn to deal with problems. People problems and environmental ones can undo all the coding skills in the world. If you're working in a space that doesn't suit your needs, nothing is going to happen. If you don't know how to get what you need politically, nothing is going to happen.

Joel, you will be missed.

Saturday, January 23, 2010

Mercurial on IIS 5.1 (XP) in 12 easy steps

Yes, I know W7 is out, but some of us are still using XP for some things.

Introduction:
With the upsurge in the use of Mercurial for version control (Even Codeplex is using it), I thought it was time to give it a try. It will take some getting used to, but a distributed VCS should fit my development style well. I carry an external drive between home and work. Right now it holds my latest code. I have to remember to commit the changes occasionally and don't always do so in a timely manner. Also, if I want to go back to an earlier version, I have to do it at work (instead of my home office when I really need it)

There are several pages showing how you can install Mercurial or HG, but my searching found none showing a straightforward "get it done set" of directions. Here's my instruction book. I've done this several times and found no issue. If you find a difference in your install, please let me know.

On with the show:
1. Install Python 2.5 - don't argue. don't resist. Mercurial is built with 2.5. Anything else WILL break it. (http://www.python.org/download/releases/2.5.4/)

2. Download and install Mercurial (http://www.selenic.com/mercurial/wiki/BinaryPackages) (Select the Windows installer)

3. Clone the Mercurial repository - you'll need some of the source code
hg clone http://selenic.com/repo/hg

4.
Create a folder to hold all the mercurial scripts
mkdir c:\hg_iis

5. Create a folder to hold your repositories (mkdir c:\hg_repos)

6. Create a virtual folder in IIS
  • Name it HG
  • Local path = c:\hg_iis
  • Execute permissions = Scripts and Executables
  • Click the configuration button
  • Click on the mappings tab
  • click the add button
  • In the Executable field enter c:\Python25\python.exe -u "%s"
  • In the Extension field enter .cgi
  • Under Verbs select All Verbs
  • Check Script engine
  • DO NOT Check Check that file exists
  • Click OK
  • Click OK
  • Click OK

7. copy the web page script to your IIS directory
copy c:\hg\hgwebdir.cgi c:\hg_iis

8. Change directories c:\program files\mercurial and unzip the file library.zip to c:\hg_iis. If you have problems with the .zip file download and run unzip.exe from stahlforce.com (http://stahlforce.com/dev/index.php?tool=zipunzip as pointed to by Selenic's site)

9. Copy the templates
copy C:\Program Files\Mercurial\Templates c:\hg_iis\Templates

10. In a text editor open hgwebdir.cgi and edit the last few lines

change
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)

to
#http://blog.mdmsolutions.org/index.php?entry=entry080508-091813
import os
os.environ["SCRIPT_NAME"] = '/hg/hgwebdir.cgi'
os.environ["REQUEST_URI"] = os.environ["SCRIPT_NAME"]

if os.environ.has_key("PATH_INFO"):
os.environ["REQUEST_URI"] += os.environ["PATH_INFO"]
if os.environ.has_key("QUERY_STRING"):
os.environ["REQUEST_URI"] += "?" + os.environ["QUERY_STRING"]

application = hgwebdir('hgweb.config')
wsgicgi.launch(application)

(indentation is important)

11. In a text editor edit or create the file hgweb.config
# Mercurial web interface config file
# To add a repository to be published, add an entry here for it.

[paths]
/ = /HG_Repos/**

[web]
style = coal

12. Now, open a browser and navigate to http://localhost/hg/hgwebdir.cgi

13. (optional) Download and install TortoiseHG http://bitbucket.org/tortoisehg/stable/downloads/