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

Cannot rebuild test dll after running tests

8 Answers 93 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.
Joel
Top achievements
Rank 1
Joel asked on 13 Jan 2011, 08:17 PM
I have a Visual Studio solution that contains a Silverlight application project in addition to a test project that utilizes the WebAii test framework.  Following is my scenario:

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

Sort by
0
Cody
Telerik team
answered on 14 Jan 2011, 04:18 AM
Hello Joel,

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?

Regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Joel
Top achievements
Rank 1
answered on 14 Jan 2011, 04:04 PM
Hi 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

0
Cody
Telerik team
answered on 14 Jan 2011, 05:32 PM
Hello 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();
}

Regards,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Joel
Top achievements
Rank 1
answered on 17 Jan 2011, 03:00 PM
Cody,

That fixed it.  Thanks for your help.

Joel
0
Di
Top achievements
Rank 1
answered on 25 May 2011, 11:54 AM
Hi!
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! 
0
Cody
Telerik team
answered on 25 May 2011, 08:19 PM
Hi Daniela,

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
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Di
Top achievements
Rank 1
answered on 07 Jun 2011, 12:19 PM
Hi Cody,
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!
0
Stoich
Telerik team
answered on 10 Jun 2011, 02:27 PM
Hi Daniela,
     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
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
Tags
General Discussions
Asked by
Joel
Top achievements
Rank 1
Answers by
Cody
Telerik team
Joel
Top achievements
Rank 1
Di
Top achievements
Rank 1
Stoich
Telerik team
Share this question
or