Test Class Inheritance

2 posts, 0 answers
  1. Filip
    Filip avatar
    5 posts
    Member since:
    Jan 2011

    Posted 28 Jan 2011 Link to this post


    I have multiple Children tests that are executed as 'test-as-step' by parent test. Since all children override the same method OnAfterTestCompleted from BaseWebAiiTest I decided to remove redundancy by introducing new class:  

    public class TestStep : BaseWebAiiTest
            public override void OnAfterTestCompleted(TestResult result)
                // My custom code goes here
      Then I updated all my children tests to inherit from TestStep class rather than directly from BaseWebAiiTest. The solution builds fine but when the tests executes and Parent tries to run any of the Children the following Exeption is thrown:  

    Error attempting to execute a Test As Step. Details:
    System.ArgumentException: String cannot have zero length.
    at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
    at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
    at System.Reflection.Assembly.GetType(String name)
    at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureTypeExists(Assembly assm, String typeName)
    at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.CreateCodedTestInstance(Test test, TestResult result)
    at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test test, TestResult initializationResult)
    at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteTestInCurrentContext(Test test)

  2. Cody
    Cody avatar
    3360 posts

    Posted 28 Jan 2011 Link to this post

    Hello Filip,

    Instead of trying to override BaseWebAiiTest I recommend you create your own test extension dll as documented here, which includes an OnAfterTestCompleted function.

    All the best,
    the Telerik team
    Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Back to Top