Archive for June, 2008

Running Selenium RC Automated Tests Automatically Without a Windows Service

Friday, June 13th, 2008

We have a suite of regression tests that we wanted to run automatically after our MSbuild build is complete. I’ve implemented these tests as C# code exported from Selenium IDE and preprocessed by some .NET code that I wrote. The tests are then compiled using MSBuild and executed.  The problem I ran into that wasn’t clearly documented anywhere was how to run a Selenium RC test as part of a build process – which requires the Java based Selenium RC server running on port 4444. Since we run our test as part of a scheduled task, how do we maintain the Java Selenium server running across logins of the scheduled task?

My first instinct was to run the Selenium server as a Windows service and I found a forum post that provided a .NET service to do this. The problem is that when the service runs in the LocalSystem’s account context, IE was problematic for enabling the proxy that Selenium RC uses during the invocation of tests.  Trying to modify the service to run as a legitimate user also didn’t work – since the service was running in a different Windows Station and IE did not run correctly in this mode either. 

It turned out the simple solution was to just invoke the Selenium Server from the build batch file and then terminate the server when I was finished with the test. There is a built in command in the command line interpreter named "taskkill" that does the job for me. Here is the .bat file code that I used – and note that the first line kills any java apps that are running so be careful.  I needed this line to abort a server in progress if the script or tests failed and left a java session hanging. My build machine doesn’t have any other java things going on so this worked for me. I’m using nunit to invoke my C# tests contained in "jalisngtests.dll". I’m also using the "sleep" command from the Windows 2003 Resource Kit.

taskkill /f /im java.exe
sleep 5
start "Selenium Server" java ^
-jar C:\selenium-remote-control-1.0-beta-1\^
copy .\bin\debug\*.dll
sleep 20
nunit-console jalisngtests.dll
taskkill /f /fi "WINDOWTITLE eq Selenium Server"

Quad Core Processors and Games

Saturday, June 7th, 2008

After listening to Leo Laporte’s UGM (ultimate gaming machine) discussion on TwitLive last night, I pondered the question of best choice for a new UGM.  I am running an Intel Q6600 (quad core 2.4 ghz) processor and have been pleased with it’s performance.

There was a spirited discussion on the show of which would be better – a Q9770 ($1400 3.2 ghz quad) or an  E8500 ($277 3.16 ghz dual core).  There was a common opinion that current games don’t make use of a Quad – that quads are for the future.  However, I experimented around Christmas time with this very issue and found that both Supreme Commander and Crysis did make use of 4 cores.  I posted in the chat room that Crysis did max out 4 cores (as I remembered) but after trying this out again – I was wrong. However, Crysis does make use of 4 cores and I do get a satisfying frame rate on my Q6600/8800GT combo.


Here is what my Q6600 utilization is while running Crysis at 1280×1024.  Not maxing out, but more than 2 cores are used. The third and fourth cores seem to get active when guns are fired – tracers, etc. Here is a post on the subject : Intel and Crysis Developers comments on Quad Core – Toms Hardware.


Supreme Commander

This is one of the first games to support a quad core processor. In the following run – I had 2 monitors displaying 1280×1024 and a very large scenario (8 players – 1000 units per). Notice that the four cores are not maxed out, but they are definitely in use. The second core is less loaded than the others but is still in use.



Games that Support Quad Core

Here is the list I found of current games that support a quad core:

Games and Dual/Quad Core Support

From the list:

Games that take advantage of Quad Core:
Alan Wake
Company of Heroes
Far Cry 2
Half-life 2: Episode 2
Hellgate: London
Lost Planet
Microsft Flight Sim X
Rainbow Six Vegas
Source Engine
Splinter Cell Double Agent
Supreme Commander
Unreal Engine 3
Unreal Tournament 3