Debugging Coded Steps

7 posts, 0 answers
  1. John
    John avatar
    2 posts
    Member since:
    May 2012

    Posted 26 Nov 2012 Link to this post

    I am trying to  debug a coded step in Visual Studio 2012.  I have set a break point in the code and tried to follow what I found in the documentation and the Forum.  I am using the trial version of Test Studio plugin for VS.  For whatever reason I cannot get it to ever hit my breakpoints that I have set in the coded file.  I have tried numerous methods to attempt this.
    If I rightclick my test from the TestExplorer and select 'Debug Selected Tests' from the popup menu.  It appears that something may be happening but nothing ever does.  In fact after having done this the timestamp in the log file is unchanged.

    I have set a break point on the CodedStep viewer and then click the green arrow button 'Quick Execute' it runs but never enters into debug mode.  It does pause where I have set my break point but not able to step into code with the debugger.

    I do not know if this has anything to do with this but I changed my test steps so that they are guarenteed not to fail.  I ran them form the step viewer to verify that they all pass.  When I try to run the test from the TestExplorer I get the following error -

    Test Name: corswebtest
    Test FullName: TestStudio
    Test Source:  : line -1
    Test Outcome: Failed
    Test Duration: 0:00:00.6308335

    Result Message: 
    One of the known types provided to the serializer via 'knownTypes' argument was invalid because it was null. All known types specified must be non-null values.
       at ArtOfTest.WebAii.Design.ProjectModel.Project.LoadTest(String filePath)
       at Telerik.TestStudio.TestAdapter.TestExecutor.ExecuteTestCase(TestCase testCase)

     



    How can I step into the debugger given my environment?
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 27 Nov 2012 Link to this post

    Hi John,

    This has become a popular question lately. To help make it crystal clear we just created and uploaded this new video which should give you everything you need to know:
    http://tv.telerik.com/watch/automated-testing-tools/debugging-coded-test-steps-in-visual-studio

    Greetings,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. John
    John avatar
    2 posts
    Member since:
    May 2012

    Posted 27 Nov 2012 Link to this post

    Thanks and this is really a great video but obviously you did not read my post as I have attempted to do exactly what is in the video.  I get the error when I follow the steps in the video.  Please see the error in my previous post.  Please read the entire original post before responding.

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    If I rightclick my test from the TestExplorer and select 'Debug Selected Tests' from the popup menu. It appears that something may be happening but nothing ever does. In fact after having done this the timestamp in the log file is unchanged.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Test Name: corswebtest
    Test FullName: TestStudio
    Test Source: : line -1
    Test Outcome: Failed
    Test Duration: 0:00:00.6308335

    Result Message:
    One of the known types provided to the serializer via 'knownTypes' argument was invalid because it was null. All known types specified must be non-null values.
    at ArtOfTest.WebAii.Design.ProjectModel.Project.LoadTest(String filePath)
    at Telerik.TestStudio.TestAdapter.TestExecutor.ExecuteTestCase(TestCase testCase)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  4. John
    John avatar
    2 posts
    Member since:
    May 2012

    Posted 27 Nov 2012 Link to this post

    Here is the answer in case anyone else runs into this problem.

    First see  http://devw.wordpress.com/2011/06/04/one-of-the-known-types-provided-to-the-serializer-via-knowntypes-argument-was-invalid-because-it-was-null/

    This is not exactly the same as they are refering to Win phone dev but this similar solution to the problem will work here.

    This is what I did to fix this problem.

    First add the following line of code to your test class.
    public class WebTest : BaseWebAiiTest
    {
        ArtOfTest.WebAii.Design.ProjectModel.Project myProject = new ArtOfTest.WebAii.Design.ProjectModel.Project("C:\\");
         
        #region [ Dynamic Pages Reference ]
     
        private Pages _pages;

    This won't compile until you add the following reference.

    System.Runtime.Serialization

    I hope this helps someone.

  5. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 27 Nov 2012 Link to this post

    Hi John,

    My apologies for missing the latter 1/2 of your original post. My mistake!

    Congratulations on finding a solution yourself! The solution you have posted makes me wonder why it was needed in the first place. Are you doing something other than ordinary simple coded steps? Are you including and referencing an external project/dll? Would you mind sending us a sample project where this solution was needed to solve the problem? We'd like to study it to better understand what's going on.

    Greetings,
    Cody
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  6. John
    John avatar
    2 posts
    Member since:
    May 2012

    Posted 27 Nov 2012 Link to this post

    Hi Cody and my apologies if I was a bit terse.  I have been wrestling with this alligator (UI testing) for about the last month.  It has been an extremely frustrating experience and I have been coding for quite a number of years so I usually don't get too frustrated with code not working.

    I doubt if the group I am currently with will allow me to share the code.  I can say this however so that you might be able to reproduce this bug.  I have created a VS 2012 solution that has multiple testing projects in it, Microsoft CodedUI, UnitTest, WebStatusTest and last but not least Telerik's TestStudio project.  I suspect if you create a testing solution with all those irons in the fire you might be able to re-create the problem.  The application that I am testing is a jQuery UI / Asp.Net MVC 3 web app with VS 2012 as the IDE.  One of the pieces that I am trying to test is the jQuery UI AutoComplete. 

    After having now used both Microsoft's Coded UI and Telerik's Test Studio I can highly recommend Test Studio and am really growing to loathe Coded UI more and more every time I use it.  There are numerous reasons for this but the main one is that Telerik's tool actually let's you get at the DOM instead of some COM object automation layer in between goop.   I have recommended that our group purchase a license for Telerik's Test Studio but unfortunately we probably won't be using it until our next project sometime in 2013.

  7. Scott
    Scott avatar
    5 posts
    Member since:
    Jun 2013

    Posted 26 Jun 2015 Link to this post

    Cody,

     These links no longer take you to the correct video.  How can I find the debugging-coded-test-steps-in-visual-studio video now?

    http://tv.telerik.com/watch/automated-testing-tools/debugging-coded-test-steps-in-visual-studio

    Regards,

     

    Scott

Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!