"In process" execution of a WPF application from arbitrary locations

Mar 9, 2011 at 9:13 AM
Edited Mar 9, 2011 at 9:17 AM

Hi

For our automated UI tests, we need to access the visual tree of the WPF application under test (since some 3rd party controls lack of automation support).
The InProcessApplication feature of the TestApi is great to handle this, and for a start this is a nice way to enable UI testing at all.

We would like to run the application under test from an arbitrary location.
i.e.

  • the test method (CodedUITest) is executed directly inside Visual Studio 2010 with debugging enabled / or automatically after a Team Build
  • the test runner should just know about the root path of the application under test
  • no other dependencies (like app.config or direct DLL references) should be needed

For now, our solution to this is the following approach:

  • The InProcessSeparateThread mode is used to run the application under test (since InProcessSeparateThreadAndAppDomain is not supported yet)
  • the app.config of the application under test is directly referenced and used as app.config of the testrunner (not nice)
  • the assemblies of the application under test are loaded in AppDomain.CurrentDomain.AssemblyResolve

Are there better ways to do this? Would it be possible to enable InProcessSeparateThreadAndAppDomain meeting the described
requirements in a forthcoming release of the TestApi?

Thanks a lot for your help.

Mar 9, 2011 at 4:55 PM

Hey Vince,

Can you help this user?

Thanks,

Ivo

From: ogirard [email removed]
Sent: Wednesday, March 09, 2011 1:14 AM
To: Ivo Manolov
Subject: Running the WPF application under test from arbitrary locations [TestApi:248980]

From: ogirard

For our automated UI tests, we need to access the visual tree of the WPF application under test (since some 3rd party controls lack of automation support).
The InProcessApplication feature of the TestApi is great to handle this, and for a start this is a nice way to enable UI testing at all.

We would like to run the application under test from an arbitrary location.
i.e.

  • the test method (CodedUITest) is executed directly inside Visual Studio 2010 with debugging enabled / or automatically after a Team Build
  • the test runner should just know about the root path of the application under test
  • no other dependencies (like app.config or direct DLL references) should be needed

For now, our solution to this is the following approach:

  • The InProcessSeparateThread mode is used to run the application under test (since InProcessSeparateThreadAndAppDomain is not supported yet)
  • the app.config of the application under test is directly referenced and used as app.config of the testrunner (not nice)
  • the assemblies of the application under test are loaded in AppDomain.CurrentDomain.AssemblyResolve

Are there better ways to do this? Would it be possible to enable InProcessSeparateThreadAndAppDomain meeting the described
requirements in a forthcoming release of the TestApi?