Thursday, August 27, 2009

The Joy of Browser Testing

One of the things I dispise the most in web application development is testing different browsers. Firefox 2, Firefox 3, Safari 4, IE7, IE8, and my most hated browser IE6. I suppose now I also include the iPhone, Blackberry, Android (or MyTouch or whatever you call it now), and Palm. However, I put my displeasure aside simply because I have to. I can't be too upset since things continue to improve (think NN4 or IE5.5), but I sure don't love it.

Well, the joy of testing won't ever go away but a couple of coworkers of mine have shown me a tool that has helped tremendously (thank you Craig and Eric!). Xenocode has a browser emulation tool that has worked very well for us. Considering that you can't have IE6, IE7, and IE8 all installed on one system (same with some other browsers), a developer was left with one ugly choice...multiple systems. Multiple systems can be sliced several ways. From physical systems to dual boot or virtualization, the fact is that you have to maintain a lot for very little benefit. In fact, Microsoft even provides a monster virtual system downloads to support IE6, IE7 or IE8.

Enter Xenocode. I haven't dove into their virtualization and streaming methodology, but I can say that they have saved me time and energy maintaining other systems for testing. It does take a bit of time to get the the engine rolling (10 minutes or so the first time). For me, it's very worth the wait. Give it a shot sometime you want to view the world with IE6, Firefox 2, or Opera.

Posted via web from A Bit of Everything

Tuesday, February 10, 2009

Ugly .Net Bug - asp:hyperlink

Recently, my crew and I ran across one of those painful bugs that takes up too much time. Ultimately, we marked it up to an ASP.NET problem. Here are the details.

We have several environments set up at work ranging from our local/developer system to our production system. In only one of our environments, the navigation in our application would disappear when a postback would occur. We use master pages and several user controls throughout the site. However, since nearly every page that performed a postback experienced the problem, we narrowed our search to the master page. Why didn't we just attach and run the application in debug mode you ask? Well, as it turns out the local environment did not exhibit the behavior. Talk about bringing debugging back to the 90s.

Further logging and testing limited the focus to the Page_Load inside the master page. Setting test points throughout the method, we narrowed it down to some extremely inconspicuous code. Here is an example of that code (obviously not the real code):

hlNav1.NavigateUrl = hlNav1.NavigateUrl.Contains("xyz") ? hlNav1.NavigateUrl : hlNav1.NavigateUrl + "&xyz=123";
hlNav2.NavigateUrl = hlNav2.NavigateUrl.Contains("xyz") ? hlNav2.NavigateUrl : hlNav2.NavigateUrl + "&xyz=123";
hlNav3.NavigateUrl = hlNav3.NavigateUrl.Contains("xyz") ? hlNav3.NavigateUrl : hlNav3.NavigateUrl + "&xyz=123";
hlNav4.NavigateUrl = hlNav4.NavigateUrl.Contains("xyz") ? hlNav4.NavigateUrl : hlNav4.NavigateUrl + "&xyz=123";
hlNav5.NavigateUrl = hlNav5.NavigateUrl.Contains("xyz") ? hlNav5.NavigateUrl : hlNav5.NavigateUrl + "&xyz=123";

As it turns out, we tried several variations of that code. Checking for null, empty, converting to an if statement, blah blah blah. We even wrapped the code above in an "if (!Page.IsPostBack)," to no avail. Here is where it gets interesting. The first time this code executes, it works perfectly. However, in this particular environment, the code blanks out any child entities when you replace the NavigateUrl (only during a postback). We had a <div> inside of each asp:HyperLink which ended up being nuked.

The solution, get rid of asp:HyperLink and use a plain old <a href="" runat="server">. How Glamorous.

At any rate, I hope this keeps someone else from burning time.

Posted via email from A Bit of Everything

Wednesday, January 28, 2009

The Linking of the Blogs


I have been resisting combining blogs and posting everywhere, but no longer. This is my first attempt at creating a publish-once post-everywhere entry. I wouldn't alter what I've been doing for so long, but lately I've been looking into Posterous. Although there aren't many options to customize the interface, Posterous is a simple blogging tool that has very powerful capabilities. For instance, if I attach an image (as I have in this example), it auto-posts it. The same holds true for video and audio. These days a blog must have native image, video, and audio support. Readers want pizaz and they can get it.

So, I guess it's time to grow up and move on. Well, maybe not move on. Posterous also allows me to auto post to Blogger and it also retains the images for my entry. It's just a win/win situation. Oh, and the picture is from Tarantinos, a local pizza joint who happens to be advertising their MySpace page.

Posted via email from ctcoley's posterous

Thursday, January 22, 2009

Wow, where did the time go?!

Well, my blog has been slightly neglected lately. I typically make a point of posting every month but I missed December. Mainly, we are cooking some exciting changes at work and I can't discuss them too much. Well, technically I've already said too much.

At any rate, we do have some great things coming and I plan on highlighting a few of the tech pieces here after the next release.