How to run code before WPF app starts?

2 posts, 0 answers
  1. Rory
    Rory avatar
    16 posts
    Member since:
    Jun 2011

    Posted 01 May Link to this post

    Greetings,

     

    I'm trying to perform some initialization before tests are run. I've reviewed a few documented methods and they appear to be inadequate (except in one case) because the app is launched before the method is executed: Custom Scripts, Execution Extension, and Cleanup.

    The Execution Extension comes the closest, and in fact the OnBeforeTestListStarted method does work, but it only works when running a test list. During running individual tests during test development, this is not used as tests are run individually.

    The problem with running cleanup in OnAfterTestCompleted seems to be that this method is not called when a test is aborted, and an invalid environment is left to manually cleanup on the next test run.

    How can I hook into test execution before the system under test app is launched to perform initialization / cleanup?

     

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    251 posts

    Posted 05 May Link to this post

    Hello Rory,

    Thank you for your interest in Telerik Test Studio. 

    By design Test Studio first runs the application and after that starts running the script. Unfortunately there is no way to go round this limitation. All custom Scripts Before/After the Test Run will be performed before or after the script against the application but the application will be already running. 

    Thank you for the understanding and do not hesitate to contact us in case of any further questions. 

    Regards,
    Elena Tsvetkova
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top