1. I run the tests successfully.
2. I make a change to my test project and rebuild.
3. I get the following build error when the test project gets recompiled: "The process cannot access the file 'bin\Debug\AcceptanceTests.dll' because it is being used by another process."
4. It turns out that the QTAgent.exe process still has a hold of AcceptanceTests.dll.
5. I use process explorer to kill the QTAgent.exe process after which the build will now successfully complete.
Although this is a solution, it is becoming quite annoying. Is there any way I can get around having to kill QTAgent each time I need to rebuild by test project?
8 Answers, 1 is accepted
What steps are you taking to run everything? I normally run my tests from a solution that contains just the test project. When I execute my test from Test View, I see QTAgent start up, the test runs, the test finishes and QTAgent immediately exists. It doesn't stick around as you describe.
What if you separated your projects into two separate solutions? Run two instances of VS, one for your Silverlight app development and the other for your test development. Does that approach work any better?
Cody
Either way, I get the same results. I am running another set of tests against a Silverlight application where the application is in one solution and the tests are in another.
Is there something special I need to do during test tear down? Right now, I'm just closing the browser (e.g. ActiveBrowser.Close(); )
Thanks.
Joel
How are your tests structured? What type of test are you using? A coded unit test or a WebAii test (i.e. a .aii file)?
If you're using a pure coded test you need to include the tear down code (and you don't need an ActiveBrowser.Close(); since our tear down code does this for you). Our standard tear down code looks like this:
// Use TestCleanup to run code after each test has run
[TestCleanup()]
public
void
MyTestCleanup()
{
//
// Place any additional cleanup here
//
#region WebAii CleanUp
// Shuts down WebAii manager and closes all browsers currently running
// after each test. This call is ignored if recycleBrowser is set
this
.CleanUp();
#endregion
}
//Use ClassCleanup to run code after all tests in a class have run
[ClassCleanup()]
public
static
void
MyClassCleanup()
{
// This will shut down all browsers if
// recycleBrowser is turned on. Else
// will do nothing.
ShutDown();
}
Cody
That fixed it. Thanks for your help.
Joel
I have similar problem, every time I want to rebuild my test project I get "The process cannot access the file because it is being used by another process.", ending QTAgent manually helps, but it's not really convenient solution.
I use standard webaii test template, so I have in my solution both this.CleanUp() and ShutDown(). Is there anything else I should do?
Thanks!
It sounds like QTAgent is not shutting down properly at the end of the test. This implies some thread in the test is sticking around and not exiting as it should. Have you manually spawned any threads? Would you mind sending us your test code so we can try to identify the problem?
Regards,Cody
the Telerik team
Register Today!
thanks for your reply. I have the application locally so you won't be able to rerun the test, but maybe you'll find something wrong in test initialization code...
Thank you!
the initialization for your test is not the problem. It's going to be difficult to get to the bottom of the issue without more info. We can give you a dropbox in private so that you can share your code with us without posting it on this public forum.
Greetings,
Stoich
the Telerik team
Register Today!