Debug Child Test Step Error

2 posts, 0 answers
  1. olof
    olof avatar
    4 posts
    Member since:
    Sep 2010

    Posted 04 Dec 2012 Link to this post


    Hi,

    Using Visual Studio 2010.

    I have watched the following http://tv.telerik.com/watch/automated-testing-tools/debugging-coded-test-steps-in-visual-studio video and I am able to debug a Parent Test step. The problem I have is that I have a Test calling another Test.

    Example
    Parent
    ...
    ...
    Exeute test 'Child'.

    When I go to Test View
    I see both Parent and Child tests. If I right click on Parent and select Debug Selection it will run the Parent Test. The problem is that the Child test does not get copied to the out directory and you get the following error in the log

    Overall Result: Fail
    ------------------------------------------------------------
    '5/12/2012 12:03:48 PM' - Using .Net Runtime version: '4.0.30319.17929' for tests execution.
    '5/12/2012 12:03:48 PM' - Starting execution....
    '5/12/2012 12:03:56 PM' - Detected custom code in test. Locating test assembly: SampleOrderForm.Tests.dll.
    '5/12/2012 12:03:56 PM' - Assembly Found: C:\Temp\Telerik\Testing\TestResults\[Username_MachineName] 2012-12-05 12_03_44\Out\SampleOrderForm.Tests.dll
    '5/12/2012 12:03:56 PM' - Loading code class: 'SampleOrderForm.Tests.Parent'.
    ------------------------------------------------------------
    ------------------------------------------------------------
    '5/12/2012 12:03:56 PM' - Detected DataDriven Test. Starting data iterations.
    ------------------------------------------------------------
    '5/12/2012 12:03:56 PM' - [Iteration #1: (OrderID=1)(OrderName=Order1)]
    ------------------------------------------------------------
    Overall Result: Fail
    ------------------------------------------------------------
    '5/12/2012 12:03:56 PM' - Using 'C:\Temp\Telerik\Testing\SampleOrderForm\bin\Debug\SampleOrderForm.exe' application.
    '5/12/2012 12:03:59 PM' - 'Pass' : 1. [Parent_CodedStep] : @"Type '' into TxtOrderTextbox - DataDriven: [$(OrderID)]
    '5/12/2012 12:04:00 PM' - 'Pass' : 2. [Parent_CodedStep1] : @"Type '' into TxtOrderNameTextbox - DataDriven: [$(OrderName)]
    '5/12/2012 12:04:00 PM' - 'Pass' : 3. [Parent_CodedStep2] : @"Click BtnOrderButton
    '5/12/2012 12:04:02 PM' - 'Fail' : 4. [Parent_CodedStep3] : @"Execute test 'Child'
    ------------------------------------------------------------
    Failure Information:
    ~~~~~~~~~~~~~~~
    Exception thrown executing coded step: '[Parent_CodedStep3] : @"Execute test 'Child''.
    InnerException:
    System.IO.FileNotFoundException: Unable to find test 'C:\Temp\Telerik\Testing\TestResults\[Username_MachineName] 2012-12-05 12_03_44\Out\Child.tstest'
       at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteTestInCurrentContext(String relativeTestPath)
       at ArtOfTest.WebAii.Design.BaseWebAiiTest.ExecuteTest(String relativeTestPath)
       at SampleOrderForm.Tests.Parent.Parent_CodedStep3() in C:\Temp\Telerik\Testing\SampleOrderForm.Tests\WPF\Parent.tstest.cs:line 97
    ------------------------------------------------------------
    '5/12/2012 12:04:02 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
    ------------------------------------------------------------
    '5/12/2012 12:04:02 PM' - Overall Result: Fail
    '5/12/2012 12:04:02 PM' - Duration: [0 min: 5 sec: 706 msec]
    ------------------------------------------------------------
    ------------------------------------------------------------
    '5/12/2012 12:04:02 PM' - [Iteration #2: (OrderID=2)(OrderName=Order2)]
    ------------------------------------------------------------
    Overall Result: Fail
    ------------------------------------------------------------
    '5/12/2012 12:04:02 PM' - Using 'C:\Temp\Telerik\Testing\SampleOrderForm\bin\Debug\SampleOrderForm.exe' application.
    '5/12/2012 12:04:03 PM' - 'Pass' : 1. [Parent_CodedStep] : @"Type '' into TxtOrderTextbox - DataDriven: [$(OrderID)]
    '5/12/2012 12:04:05 PM' - 'Pass' : 2. [Parent_CodedStep1] : @"Type '' into TxtOrderNameTextbox - DataDriven: [$(OrderName)]
    '5/12/2012 12:04:05 PM' - 'Pass' : 3. [Parent_CodedStep2] : @"Click BtnOrderButton
    '5/12/2012 12:04:06 PM' - 'Fail' : 4. [Parent_CodedStep3] : @"Execute test 'Child'
    ------------------------------------------------------------
    Failure Information:
    ~~~~~~~~~~~~~~~
    Exception thrown executing coded step: '[Parent_CodedStep3] : @"Execute test 'Child''.
    InnerException:
    System.IO.FileNotFoundException: Unable to find test 'C:\Temp\Telerik\Testing\TestResults\[Username_MachineName] 2012-12-05 12_03_44\Out\Child.tstest'
       at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteTestInCurrentContext(String relativeTestPath)
       at ArtOfTest.WebAii.Design.BaseWebAiiTest.ExecuteTest(String relativeTestPath)
       at SampleOrderForm.Tests.Parent.Parent_CodedStep3() in C:\Temp\Telerik\Testing\SampleOrderForm.Tests\WPF\Parent.tstest.cs:line 97
    ------------------------------------------------------------
    '5/12/2012 12:04:06 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
    ------------------------------------------------------------
    '5/12/2012 12:04:06 PM' - Overall Result: Fail
    '5/12/2012 12:04:06 PM' - Duration: [0 min: 4 sec: 87 msec]
    ------------------------------------------------------------
    ------------------------------------------------------------
    '5/12/2012 12:04:06 PM' - Overall Result: Fail
    '5/12/2012 12:04:06 PM' - Duration: [0 min: 9 sec: 813 msec]
    ------------------------------------------------------------
    '5/12/2012 12:04:06 PM' - Test completed!

    Any ideas on how to solve this?

    Thanks Olof
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 05 Dec 2012 Link to this post

    Hello Olof,

    You should enable Deployment in your Test Settings file in use by the Project/Solution in the Solution Explorer. Click Deployment in the left column and check Enable Deployment.

    By enabling Deployment, you are telling Visual Studio to copy all files for the project to the Out Directory. When it is disabled, everything runs out of the root folder for the project/solution.
     
    Read more about Deployment here.

    Regards,
    Boyan Boev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top