G
Guest
I'm having difficulties getting a test application to work. The application
being tested runs on Pocket PC 2003 and uses the dotNet Compact Framework 2.0.
To be able to test our application we wrote a test application based on
information in an MSDN Magazine article that used reflection for User
Interface testing. See
http://msdn.microsoft.com/msdnmag/issues/05/01/TestRun/. In our case the
application being tested is somewhat more complex. To successfully run the
application the Main method must be executed.
When using the suggested Assembly.CreateInstance the application will raise
an exception. This because the CreateInstance method will run the
constructor. However, to run the application, the main method must be
executed.
While looking for other solutions I came across a method that I was looking
for. I am able to run the application in a separate thread and run the Main
method. This makes use of the AppDomain.ExecuteAssembly method. The problem
is that I need an object handle for the application.
I also tried to invoke the Main method after creating an instance of the
application. This causes an exception as well because the constructor will be
executed twice.
I think the best solution would be to use the ExecuteAssembly method and get
an object handle. But I cannot find a way to do that.
Solutions or alternatives are muchly appreciated…
being tested runs on Pocket PC 2003 and uses the dotNet Compact Framework 2.0.
To be able to test our application we wrote a test application based on
information in an MSDN Magazine article that used reflection for User
Interface testing. See
http://msdn.microsoft.com/msdnmag/issues/05/01/TestRun/. In our case the
application being tested is somewhat more complex. To successfully run the
application the Main method must be executed.
When using the suggested Assembly.CreateInstance the application will raise
an exception. This because the CreateInstance method will run the
constructor. However, to run the application, the main method must be
executed.
While looking for other solutions I came across a method that I was looking
for. I am able to run the application in a separate thread and run the Main
method. This makes use of the AppDomain.ExecuteAssembly method. The problem
is that I need an object handle for the application.
I also tried to invoke the Main method after creating an instance of the
application. This causes an exception as well because the constructor will be
executed twice.
I think the best solution would be to use the ExecuteAssembly method and get
an object handle. But I cannot find a way to do that.
Solutions or alternatives are muchly appreciated…