Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Ifeanyi Echeruo

Ifeanyi Echeruo crnriman

Niner since 2006

Forum Thread Replies Latest activity
The Sandbox UI Automation Stress 1
  • Ifeanyi Echeruo: Testing WPF - UI Fuzzing with InvokeStress

    1) Do i need to import some additional dlls / packages ?Channel9.Samples.Test.Stability"

    2) Do I need to add the provided classes into some solution & rebuild the same ?

    You dont need to do either of those.
    The tests run in an application separate from your products application.

    In other words all you have to do is

    Build my application
    Run your application
    Run my application with command line arguments telling it how to find your running application.
  • Ifeanyi Echeruo: Testing WPF - UI Fuzzing with InvokeStress

    Q. How safe is this to leave unattended?

    Well like I said I've been using it to internally test a couple of apps for a few months. In overnight runs it hasnt had unwanted side effects on other applications or the operating system. There is always the chance it could trigger a 'catastrophic' code path in the application being tested but thats why you would be running it to begin with.

    I'd prefer running on as close to the target environment as possible but running in a VM is still an excellent option esp. since you can get freaky and still feel safe (e.g several concurrent instances on multiple accounts with varying system privilages)

    Q. How difficult would it be to adapt this technique to record your (or your users') actions as you drive your application?

    Recording actions is easy. Capturing enough information to reliably playback is very difficult.
    The most prominent problems are
        deriving a persistent id for AutomationElements that are not explicitly labeled
        recording enough information to gate playback.
    eg.
       1) Click login, 
       2) wait for sign-in to complete
       3) wait for contacts list to populate
       4) Double Click on contact

    Between each action is a signal that playback needs in order to issue the next action at the right time. It isnt always event driven, sometimes you may need to poll. For network based apps your environment could be wildly different with every run and the actions need to adapt.

    I know there are companies that sell software that does this. I haven't played with any so I dont know what state of the art is in this field. Perhaps a knowledgable Niner can enlighten us?

    Based on my experience what I would recommend writing down a scenario on paper (you did do that when you were spec'ing the app right? Wink)
    Then convert that scenario to code.

    e.g
    Click on button X
    Select radio button Y
    Select textbox Z
    Type "Channel 9 Rocks"
    Click Ok

    try {
      AutomationElement xButton = MyElementHelper.Find(uiRoot, "X", ControlType.Button);
      Input.MoveToAndClick(xButton);
      ...
      AutomationElement zTextBox = MyElementHelper.Find(uiRoot, "Z", ControlType.Text);
      Input.MoveToAndClick(zTextBox);
      Input.SendUnicodeString("Channel 9 Rocks", 100, 100);
      .... 
      AutomationElement okButton = MyElementHelper.Find(uiRoot, "Ok", ControlType.Button); //this is not the best way to invoke the ok button
      Input.MoveToAndClick(okButton);
    }
    catch(MyElementNotFoundException) {
      //report that the automation failed
    }

    Scripting this sort of automation is something I am getting more and more interested in but I have no budget (time wise) to chase this right now

     

  • Ifeanyi Echeruo: Testing WPF - UI Fuzzing with InvokeStress

    Sad

    I'll try to keep that in mind for the future.

    Still you can grab the sources (5 files or so) and search for the API's mentioned </plug>
  • Ifeanyi Echeruo: Testing WPF - UI Fuzzing with InvokeStress

    http://channel9.msdn.com/ShowPost.aspx?PostID=226785
    Will get you to the bits a tad bit quicker