You learn something new everyday, and sometimes you learn that you don’t really understand some fundamental things. So, let’s share johnny the developer’s ignorance.
Background: I was setting up some WatiN automated acceptance tests for an older Asp.NET Web Forms site.
<digression> I was using WatiN because I’ve used it before, but it looks like it hasn’t been updated in a year. Is it no longer an active project? Should I be looking at WebDriver instead?</digression>
WatiN natively uses a lot of magic strings, and so there is a lot of ‘opportunity’ to fat finger stuff, and of course, that’s what I did. I was doing something really basic: setting up a test to ensure that when the value of DropDownList1 changed, the items in DropDownList2 were repopulated properly. Since I fat fingered the control to look for, the test failed.
Not seeing my obvious typo, I did a view source of the page. Blink. WTF. The view source did not show what was actually rendered. I called over another of the web developers, and he too was surprised at this.
Another developer asked if I was using an UpdatePanel. I didn’t create the site, but yes, that is something that was being utilized, but that still didn’t make sense to me. Shouldn’t the view source reflect the state of the page after all rendering was done?
Like the other developer I asked, it isn’t something that I had ever looked at before, and never thought to question it.