in

Utah .NET User Group

Home of Utah's professional .NET developers.

Matthew M. Osborn's Blog

  • Running the Lightweight Test Automation Framework for ASP.NET from a separate application

    In some instances it might be best if your tests did not run in the same application as the website being tested.  This is where the “IApplicationPathFinder” interface comes into play.  If you implement this interface you will see that it only has one method “GetApplicationpath.”  What this does is allow you to specify a prefix of sorts for the navigate method.  When you call navigate on a HTMLPage it uses a ApplicationPathFinder to get the location it should look for the website at.  For example, the framework will implement this interface and simply return “http://localhost” by default.  Creating your own ApplicationPathFinder class allows you to specify where to look for the website, there is nothing stopping you from telling it to look for “http://foo.com.”  The fallowing code shows a simple implementation of the IApplicationPathFinder interface, that points to a second test application. This code is place in the DrivePage that is located in the “Test” folder.

    <script runat="server">
        public class TestApplicationPathFinder : Microsoft.Web.Testing.Light.IApplicationPathFinder
        {
            public string GetApplicationPath()
            {
                  return "http://localhost/TestApp2";
            }
        }
    
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
    
            Microsoft.Web.Testing.Light.ServiceLocator.ApplicationPathFinder = new TestApplicationPathFinder();
        }
    </script>

    Okay, lets take a look at what is really going on here in the code.  First I choose to include the  implementation of the IApplicationPathFinder interface in the DriverPage, however, this could easily be moved to its own file/assembly.  Other than that the code is pretty straight forward, set the ApplicationPathFinder property on the ServiceLocator to an instance of your implementation.

    There are numerous reason you might want to run the the test application separately from the site you are testing.  Here is a simple implementation that allows you to store your test application in a central location and pass the location of the site to be test to it.  You could use a URL like “http://localhost/Test?tag=localhost2&filter=true&path=http%3A%2F%2Flocalhost2&run=true” to the navigate and have the test page look for the site at “http://localhost2,” show only the test with the tag name “localhost2,” and run them once navigation is complete.  You could see how you could use this to set up a regression test bed, by storing all your tests in one location and pointing them to the proper servers for the pages.

    <script runat="server">
        public class TestApplicationPathFinder : Microsoft.Web.Testing.Light.IApplicationPathFinder
        {
            public string Path { get; set; }
    
            public TestApplicationPathFinder(string path)
            {
                Path = path;
            }
            
            public string GetApplicationPath()
            {
                return Path;
            }
        }
    
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            string path = this.Request.Params["path"];
            if(!string.IsNullOrEmpty(path))
                Microsoft.Web.Testing.Light.ServiceLocator.ApplicationPathFinder = new TestApplicationPathFinder(path);
        }
    </script>
    Hopefully this gives you some insight into the power that the Lightweight Test Automation Framework for ASP.NET has and how you can leverage that power.  You can download the framework here. Please let me know if you have any questions.
  • Microsoft .NET gets a facelift

    asp.net For those of you who have been living under a rock today you might not have noticed that the Microsoft .NET logo got a face lift.  I know it’s about time!  Find out about all the new features being released at PDC08 at http://microsoftpdc.com

  • Tech&middot;Ed EMEA 2008

    clip_image001Well it’s official I will be going to Tech·Ed EMEA this year.  This will be my first time in Spain so it should be fun.  I will be working the ASP.NET booth for the developer portion of the conference, November 10th through the 14th.  If your going to be there look me up at the booth.  If there is anything you want to find out while I’m in Spain or at Tech·Ed let me know.  Any ideas for a small 20-30 minute talk?  If you’re interested there is still time to register and make the trip!

  • CSS201: Theory and Practice


    To fallow along with this screen cast visit http://css201.osbornm.com

    To download the source for this screen cast visit http://www.osbornm.com/css201.zip

  • NexusLight: The ASP.NET QA Framework

    NexusLight

    Yesterday, the Microsoft ASP.NET QA team released a sample to Codeplex that exposed the world to NexusLight.  NexusLight is the framework that the ASP.NET team uses to test all of our Features.  Before I get a million questions about this let me say that there is nothing amazing or revolutionary in this sample.  It was released simply to introduce the world to how Microsoft goes about testing it’s cycle and how we do things.  You might like it you might not, but never-the-less its there to be downloaded and played with.  Within the next couple of days I will be posting a more in-depth series of screen casts about how to use NexusLight. Please, let us know if there is anything you’d like to learn more about and we’ll see what we can do for you.

    NexusLight Release Notes

    NexusLight Web Test Automation Framework Samples

  • CSS 101: The Basics


    To fallow along with this screen cast visit http://css101.osbornm.com

    To download the source for this screen cast visit http://www.osbornm.com/css101.zip

  • Master pages and their not so master life style

    There is no great secrete that I'm letting out of the bag but it is something that I never really had the need to stop and think about, it was just something that I took for granted.  Maybe I thought that it worked by some form of magic, maybe I just never cared, but today I'd like to talk about what a master page really is.  I always thought that a master page was simply that, a page.  This makes since based on the name and the behavior that it has right?, wrong.  If you open up reflector and take a look at the master page class it inherits from System.Web.UI.UserControl and not from page.  Once I stopped and thought about this for a minute it makes since. Master pages were introduced in FX 2.0 and by not adding anything as the parent of page there would be very little work that would need to be done to implement this. So how do we get the master page to appear to be the parent of page you might ask yourself.  Well here is were the ContentPlaceHolder and Content controls come into play.  They simply control where the page's content is placed when the page is rendered.  ASP.net is aware of the master page control, because of the reference in the page declaration, and places the markup inside the Content Control inside of the ContentPlaceHolder Control.  This gives the effect of the master page acting as the parent of page without actually changing the control hierarchy. Like I said this is no great secrete but simply something I had never stopped to think about.  The reason I stopped to think about it is that I plays a part in a feature I am working on for the next version of the framework, stay tuned for more information about that feature after PDC08.

  • Mojave: The Next Microsoft OS

    Many people HATE vista, even people that are not tech savvy seem to hate it!  It’s slow, it crashes, and people have heard nothing but bad things about it.  Well I’m going to let all of you in on a little secret! This will all be fixed by Mojave: The Next Microsoft OS!  Check it out for yourself http://www.mojaveexperiment.com/

  • One month @ Microsoft

    IMG_2654 This last week I had my one month anniversary at Microsoft.  I put off writing a post about the process and my new job because I wanted to do it after a few weeks of work and settling in.  So what better time then at one month.  I figured I would cover the process of getting the job and what I do at my job.  Please feel free to ask any questions you want. 

    Okay, lets start with how I got the job. After graduating college I started email correspondence with ScottGu to ask for some advice about how to be successful and enjoy what you do.  To my delightful surprise I was getting several page emails with very valuable information (in my opinion he is the most devoted developer in the community).  One thing lead to another and he ended up putting my resume in the system, I'm sure it was because of my ability and charm not the referral bonus (jk Scott).

    I was contacted by several groups inside the UIFX teams and had several phone interviews back and forth.  After about a month I was invited up to Redmond to interview with the UIFX QA team.  Now here is where I will be completely honest, I was just like every other developer out there and carried a stigma about QA.  let me just tell you this, after meeting with them and having worked for them for a month QA developers are some of the best programmers out there!  QA devs have to understand how the software will be used and all the crazy ways it will be used in addition to understanding the low level of how it was implemented.

    So the day of my interviews was one of the most nerve racking days of my life.  Walking in all you know is that you will have at least three interviews, you might have more but its not for sure. For me the first interview was the worst, I wasn't sure what they were looking for and I was asked questions that I was not expecting.  I was expecting more questions about the framework itself however they were more general program questions.  The first question I was asked was to implement, in any language I wanted, a bit array class with focus on the getIndex method and efficiency. Looking back on it, it wasn't that hard of a question but I was nervous and it caught me off guard.  For those of you who are wondering look up bit shift operators.  Any way to keep a long story half way short I returned home and got a call the next day offering me the position.

    Okay so now for some interesting stuff, what I actually do all day long.  Well besides drink the free coffee and soda and play foosball I am an SDET (Software Development Engineer in Test) for the UIFX Server team.  That just a fancy way of saying the ASP.NET and Silver light team, we are working on changing our name to just ASP.NET.  To set things straight no I don't just write unit tests all day long.  Unit tests are mainly written by the developers themselves.  We were refer to our job as being the first customer of the product or feature.  We still write automated tests both for runtime functionality, method calls do the right thing, and design time tests, making sure the product or feature works properly with the IDE. However we have adopted the idea that we are the first customer so we also create sample applications and simply use the feature or product and log issues.

    My first month has not been what I expected.  First off I imagined that the honeymoon phase would have wore off by now but it still doesn't feel like work to me.  Now don't get me wrong I am not complaining about this I want this phase to last as long as possible.  The second thing that I didn't expect was to have the level of responsibility that has been assigned to me in the first month.  Currently, I am responsible for anything to do with page framework, so all the basic controls and features of ASP.NET.  Another thing that was surprising to me was the sheer amount of resources available to you as a Microsoft employee.  Everything from cell phone plans to books to hardware to training. I will say that working for a big corporation has its perks! One thing that throw me off guard and is possibly my favorite part about working for Microsoft is the people that I get to interact with everyday.  I hadn't put much thought into it so I guess that's why I didn't expect it but I get to work with basically ever person on my blogroll.  Everyday I am surrounded by some of the smartest people in the ASP.NET world! Overall, I would have to say that there isn't a better job for me, I love working at Microsoft.

  • The Big Blue Monster | My move to Redmond, WA

    myOffice I normally try to keep my blog entries to code related topics.  However, I think I can make an exception for this one entry. For those of you who do not know yet, I have been presented with a once in a life time opportunity.  Starting in June, I will be working for the Big Blue Monster, that is right Microsoft.  I will be moving to Redmond, WA and working on the UIFX server side team.  That includes ASP.NET, AJAX.NET, and Silverlight.  All the work I will be doing with be for version 4.0 of the framework.  I can't wait to get started, this should be a great experience for me and I should be able to learn so much! The picture is of the building I will be working in on campus.

  • Mobile Browser Test

    The WC3 Web Test Suites Working Group has just announced that they have a test for mobile devices.  This is an important step as mobile connectivity grows. So head over to there test and see how your mobile device handles it. Short address for the test is http://icanhaz.com/wt

  • Community Launch Event | Thanks

    Heroes Community Launch

    I wanted to thank everyone who came out to the Community Launch and listened to my presentation or pretended to listen. If you didn't come I spoke on the new features of SQL Server 2008.  With in the next few months I will be presenting again on SQL Server 2008 but with in depth examples and walk through's. 

    If you are interested a copy of my slide deck can be found here

  • Community Launch Event | April 10th

    Heroes Community Launch

    The Utah .NET Users Group will be hosting a Community launch event for Visual Studio 2008, Windows Server 2008, and SQL Server 2008. This is a series of event across the country hosted by users groups and sponsored by Microsoft, Ineta, Culminis, and Pass.  The Utah .NET User Group has decided to make this a four part launch event.  The first being a overview of all three new technologies, with the fallowing three being a in depth look at each technology.  I myself will be speaking about SQL Server 2008 during the launch event series.  So please come and join us on April 10th.  For more information please visit http://utahdnug.org/

  • Coding Question: Max Consecutive Characters

    Recently I was asked to code a simple method.  This method should take in two parameters a string and a character.  The goal of the method was to count the max number of consecutive times the character parameter appeared in the string.  So an example would be that the string "abaabbaaa" is passed into the method along with the character 'a' The method should then return 3 because the character 'a' appears 3 times in a row.  This seems like a very simple method but it is actually very trick to make it efficient.  So let see what you guys can come up with, post your solution in the comments section.  I will be posting the solution in a few days.

    Posted Apr 05 2008, 11:32 AM by Matthew M. Osborn
    Filed under:
  • Acid3 Released

    For those of you who don't know there is a series of web standards tests known as the Acid tests.  These test are basically designed to see how close to the standard a browser renders objects.  Just a short while ago the IE8 team released a video on Channel9 saying that they had successfully rendered the Acid2 test.  But the IE8 team need not celebrate too long because the WSP has just released a new acid test ACID3.  This test targets more of the browsers DOM scripting abilities than anything else.  So IE8 team good luck getting this test to work :) Here are some screen shots of the test ion both IE7 and FF2.

    ieAcid3 ffAcid3

More Posts Next page »
Copyright © 2000-2007, Utah .NET User Group
Powered by Community Server (Commercial Edition), by Telligent Systems