Lance Ahlberg's WebLog

Reflection on reason

May 2004 - Posts

Argument Exception - Absolute path information required with NUnit

I have been getting an argument exception with details “Absolute path information required”, this exception was happening when I was running Tests with Nunit.

After almost pulling my hair out the problem was found, Environment variables....

Nunit caches the assemblies that are being tested in the temp directory, and uses the TEMP environment variable.  Of course my TEMP environment variable was a relative path.

So the moral is, if you see Absolute path information is required take a look at your environment variables and ensure that they are absolute.

 

 

More on getting NUnitAsp LinkButtonTester to work with VS2005

More on getting Nunitasp working with VS2005.  I have been having a problem with the LinkButtonTester, and it turns out that ASP.NET 2.0 doesn't like having “NunitAsp” as the Http Request UserAgent setting.   When I set the UserAgent to be Mozilla/4.0 the page was rendered correctly.

So if you are have problems with LinkButtonTester make sure you include the following in your test or test fixture setup..

Browser.UserAgent = "Mozilla/4.0";


I have recently encountered another issue with the LinkButtonTester. I had a page with a LinkButton, TextBox, and Field Validator.  The rendered page used a different javascript function called

WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(“test“,““,true,))

The LinkButtonTester didn't like this at all raising a parse exception.

It turns out that in ASP.NET 2.0 validation is also performed client side using various javascripts, and when a linkbutton is clicked it triggers the client side validation to occur.

So in order to turn off this behaviour and return to the old __doPostBack function I set the LinkButton's CausesValidation property to false.

 

 

Getting NunitAsp LinkButtonTester working with ASP.NET 2.0 (Whidbey Alpha Community Edition)

I have recently been investigating a exception raised when I call the click method of the LinkButtonTester within NunitASP.

This wasn working fine with ASP.NET 1.1 but is now broken with ASP.NET 2.0.

I debugged the operation of Nunit to see what was causing the exception and used a simple scenario with a aspx page with a link button.

It turns out that the server was not emitting the __EVENTTARGET and __EVENTARGUMENT fields or the __doPostBack script, even though the anchor was still referencing the script.

When I call the page via Internet Explorer, the page was emitting correctly.

I can only assume that ASP.NET 2.0 is expecting something in the HTTP Request that NunitAsp is not currently providing.

Does anyone have an ideas on this?

 

More Posts