Unable to find the test class / method does not exist

6 posts, 0 answers
  1. Eddie
    Eddie avatar
    4 posts
    Member since:
    Dec 2013

    Posted 30 Jul 2015 Link to this post

    I need some help with some problems that's been preventing me from using the test studio.

    Very often when I add a coded step in newly created test, the compilation fails and gives me this error:

        '01/01/2015 14:09:53' - System.ArgumentException: Unable to find the test class type 'TestProject2.WebTest' in your test assembly. Please make sure your test     code behind is compiled with your latest changes.
           at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureTypeExists(Assembly assm, String typeName)
           at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.CreateCodedTestInstance(Test test, TestResult result, String binariesFolder)
           at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test test, TestResult initializationResult)
           at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(ExecuteTestCommand command)

    The test has only a single test step and it's a coded step without any code written.
    If I were to delete the step and clear the script file, then add any steps that aren't coded step, it will have no problem compiling.
    All the other tests that existed before this test runs perfectly fine.
    This problem cannot be resolved by creating new tests, but only by creating a new project.

    There's another error besides the mentioned one that's been occurring just as often, it's also caused by adding a coded step.
    This time the codes compiles without error, but throws an exception when the coded step was hit:

        Exception thrown executing coded step: '[TEST_001_Inbox_Actions_CodedStep] : New Coded Step'.
        The coded step method 'TEST_001_Inbox_Actions_CodedStep' does not exist.

    The step hasn't have any code written to it and the method name is the one that was generated by the test studio.

    There's another version to this problem, sometimes it doesn't throw the exception unless the name of the method is changed.
    Even if I stick to the method name that was originally generated for, the test will compile and run,
    but the codes I've written in that method would have no effect whatsoever.
    My guess is that the code behind did not get updated and the changed code wasn't compiled.

    Product Version: 2014.4.1211.0

  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 03 Aug 2015 Link to this post

    Hello,

    That sounds like a project compilation problem. Basically Test Studio checks for a code-behind file comparing the file date modified with the .DLL modified date. If the script file is newer TS calls the compiler to get the latest .DLL.

    Do you get that in Visual Studio or it's Test Studio IDE where you hit that?

    Also can you please try the latest Test Studio release we publish at the end of July and see if you still get that problem? The exact version is labeled 2015.2.723.

    Regards,
    Konstantin Petkov
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Harsha
    Harsha avatar
    8 posts
    Member since:
    May 2017

    Posted 19 Aug Link to this post

    Hi,

    I'm facing the similar issue in Version 2017.1.207.0.

    ------------------------------------------------------------
    '8/19/2017 4:57:08 PM' - Executing test: <>, path: <>
    '8/19/2017 4:57:08 PM' - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2017.1.207.0'.
    '8/19/2017 4:57:08 PM' - Starting execution....
    '8/19/2017 4:57:10 PM' - Detected custom code in test. Locating test assembly: <>.
    '8/19/2017 4:57:10 PM' - Assembly Found: <>
    '8/19/2017 4:57:10 PM' - Loading code class: <>.
    '8/19/2017 4:57:10 PM' - Failure detected during execution. Details:
    ------------------------------------------------------------
    '8/19/2017 4:57:10 PM' - System.ArgumentException: Unable to find the test class type <> in your test assembly. Please make sure your test code behind is compiled with your latest changes.
       at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureTypeExists(Assembly assm, String typeName)
       at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.CreateCodedTestInstance(Test test, TestResult result, String binariesFolder)
       at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test test, TestResult initializationResult)
       at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(ExecuteTestCommand command)
    ------------------------------------------------------------
    '8/19/2017 4:57:10 PM' - Test completed!

    When I created the same test steps of above in a different test case name, that test script executes fine without any errors.

    Before getting this error, there was an duplicate element which I was not able to either edit or delete and then I followed the steps in "http://docs.telerik.com/teststudio/knowledge-base/project-configuration-kb/merge-page-nodes#page-nodes" and facing above issue afterward.

     

    Regards,
    Harsha

     

  4. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    656 posts

    Posted 22 Aug Link to this post

    Hi Harsha,

    Thank you for reaching us out. 

    Could you please double check if you are able to compile the project in Test Studio at all? If there are any errors you will get notified in the Output panel. Please resolve the errors if any and then try again. 

    You might need to change the Namespace in the coded step but since you have removed the exact names from the error message I am unable to provide more exact suggestion. 

    Please let me know if I could be further helpful with anything. Thanks in advance for your cooperation! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  5. Harsha
    Harsha avatar
    8 posts
    Member since:
    May 2017

    Posted 22 Aug in reply to Elena Tsvetkova Link to this post

    Hi Elena,

    I have already compiled the code (project) and there were no errors shown in the Output.
    I had no choice other than removing this test case and create the same steps under a different test case name.

    Regards,
    Harsha
  6. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    256 posts

    Posted 25 Aug Link to this post

    Hi Harsha,

    Did that resolve the problem? To have a fresh compilation you could try to remove the \bin folder under the project folder structure and to compile again the project.

    Kind Regards,
    Nikolay Petrov
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top