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

How to run code before WPF app starts?

1 Answer 223 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.
Rory
Top achievements
Rank 1
Rory asked on 01 May 2016, 12:22 PM

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?

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 05 May 2016, 05:41 AM
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
 
Tags
General Discussions
Asked by
Rory
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or