<p>I am putting together some ideas for our automated testing platform and have been looking at Selenium for the test runner.</p>

<p>I am wrapping the recorded Selenium C# scripts in an MbUnit test, which is being triggered via the MbUnit NAnt task. The Selenium test client is created as follows:</p>

<pre><code>selenium = new DefaultSelenium("host", 4444, "*iexplore", "http://[url]/");
</code></pre>

<p>How can I pass the host, port and url settings into the test so their values can be controlled via the NAnt task?</p>

<p>For example, I may have multiple Selenium RC servers listening and I want to use the same test code passing in each server address instead of embedding the settings within the tests themselves.</p>

<p>I have an approach mocked up using a custom NAnt task I have written but it is not the most elegant solution at present and I wondered if there was an easier way to accomplish what I want to do.</p>

<p>Many thanks if anyone can help.</p>

Anytime I need to integrate with an external entity using NAnt I either end up using the
exec task
or writing a
custom task
. Given the information you posted it would seem that writing your own would indeed be a good solution, However you state you're not happy with it. Can you elaborate a bit on why you don't think you current solution is an
elegant
one?
Update
Not knowing
internal
details it seems like you've solved it pretty well with a custom task. From what I've heard, that's how I would have done it.
Maybe a new solution will show itself in time, but for now be light on yourself!