This is a migrated thread and some comments may be shown as answers.

Debugging Coded Steps

6 Answers 294 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 26 Nov 2012, 11:51 PM
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?

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 27 Nov 2012, 03:13 PM
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
0
John
Top achievements
Rank 1
answered on 27 Nov 2012, 05:04 PM
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)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0
John
Top achievements
Rank 1
answered on 27 Nov 2012, 05:52 PM
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.

0
Cody
Telerik team
answered on 27 Nov 2012, 08:55 PM
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
0
John
Top achievements
Rank 1
answered on 27 Nov 2012, 09:53 PM
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.

0
Scott
Top achievements
Rank 1
answered on 26 Jun 2015, 05:39 AM

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

Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Cody
Telerik team
John
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Share this question
or