Locked Test Script generation using VSTS recorder

  • Friday, June 25, 2010 5:32 AM
     
     

    Hi,

    Is it possible to un plug the default code generation module in Recorder(VS2010) and have our own module which generates test script as per our requirement?

    I have read about this some time back and now i am not sure how to do this. Please let me know if it  is possible.

    Thanks

    Sumanth

All Replies

  • Friday, June 25, 2010 4:11 PM
     
     Proposed

    Look at gautam's reply in this thread.

    http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/8e4a08f3-cbc8-444d-85cd-3125f7e0ce48


    Please mark the post as answered if this answers your question. ThejK
  • Monday, June 28, 2010 6:41 AM
     
     

    Hi

    Thread you provided talks something different. I am interested in asking the recorder to generate the code as per my template instead of creating a class for every control which inherits WinButton/WPFButton etc.

    Is that kind of code generation possible ?

    Thanks

    Sumanth

  • Monday, June 28, 2010 9:36 AM
     
     

    I am not sure if you read the correct reply in the thread. Copy pasting gautam's reply from that thread.

    --------------------------------------

    You can do something like this -

    UITest mytest = UITest.Create(@"path\mytest.uitest");

    using (UITestInterpreter interpreter = new UITestInterpreter(mytest))

    {

        interpreter.ActionInvoker = myCodeGeneratorActionInvoker;

        interpreter.ExecuteTest();

    }

    For references on the above classes, see MSDN.  These classes are there in *.UITest.Common.dll and *.UITest.CodeGeneration.dll.  Your program needs to able to find and load CodeGeneration.dll etc.  The easiest way for that is to install the program in Common7\IDE path (same as CodedUITestBuilder.exe) and use the config file's probe path (again check CodedUITestBuilder.exe.config for example).

    Thanks.


    http://blogs.msdn.com/gautamg

    -------------------------------

     

     

     

     


    Please mark the post as answered if this answers your question. ThejK
  • Tuesday, June 29, 2010 4:31 AM
     
     

    Hi

    I am still not clear with the solution.

    I use VSTS recorder for recording the action on my application. Once recording is done i go for code generation and expects the code that gets generated is what i required.

    Now in the below code where can i ask the interpreter to generate code as i desire. Do i need to have an overload of interpreter.ExecuteTest() ?

    What is "myCodeGeneratorActionInvoker"? Can i have the full code.

    UITest mytest = UITest.Create(@"path\mytest.uitest");

    using (UITestInterpreter interpreter = new UITestInterpreter(mytest))

    {

        interpreter.ActionInvoker = myCodeGeneratorActionInvoker;

        interpreter.ExecuteTest();

    }

    Thanks,

    Sumanth