
I had upgraded to VS2010 but still using .NET Framework 3.5 for the projects. I tried to create UI test for our project using VS2010. When i tried to create a new test, the default framework of the test is set to .NET 4.0. I tried to set the framework to 3.5 manually but it doesn't allow me to do so. With this, i'm having problem with automating and running my tests in CI(Continuous Integration), as we're not going to upgrade our project to .NET 4.0 so soon and CI doesn't allow both .NET 3.5 and .NET4.0 to run together in one project. Is there any way to set the .NET Framework to 3.5 when i create new test in VS2010 for the projects? Pls help. Thanks
12 Answers, 1 is accepted
It seems they've done that by purpose. See this MS Connect bug for details. There is a work-around there but I haven't personally tried that. You can check if that works for you though. I hope this helps!
Sincerely yours,
Konstantin Petkov
the Telerik team

I tried and looks like it doesn't work for UI test project. It works fine for other project type. When i tried to edit the framework version to 3.5 in my UI test csproj file, after i reload, it'll force to me convert back to .NET 4.0, and this only happens for UI test project type.
I see and I hope they can enable the multi-targeting to address this issue in a future Visual Studio release. In the meantime it seems you need to keep the dev and CI in sync and run only in .Net4 environment. Unless of course you have a VS 2008 installed on your machine as well and use it to create test projects.
Sincerely yours,
Konstantin Petkov
the Telerik team

Thanks for the fast response. We won't be able to convert our project to .NET 4.0 so soon and we had already converted all our solution files to VS2010, so we won't be able to work on this in VS2008.
There are 2 different NUnit tests in our project, which, one of it is converted from UI test. Currently, as UITest we created is in .NET 4.0, so we edit NUnit tool to enable running test for .NET 4.0. Means we have 2 different NUnit tool, which, 1 is for our normal NUnit tests, and 1 for UITest. We're having problem in integrating UI test with CI, with the error message as attached. Any idea on how to solve this?

We create our UI test on developer's machine using VS2010(.NET 4.0). In our build server, we have VS2008 with Web UI Test Studio installed. We'll run our tests in this build server. In order for us to run our UI test in CI, do we need VS2010 to be installed on this build server?
At least you need MSTest compatible with .Net 4.0. MSTest comes either with VS or as a separate distribution. I spotted they mention it in their recently posted FAQ here.
A colleague proposed another solution you may want to give a try. That is applicable for coded tests only where you just need the .dll to point to MSTest. So if you plug your coded test in a non-test project you can then convert it manually to .Net 3.5 compatible project and get a .dll MSTest for 3.5 should be able to run.
Kind regards,
Konstantin Petkov
the Telerik team

We're converting our recorded steps to NUnit and CI will run the NUnit tests only.
Do u mean that after we converted the test into NUnit test, we can manually copy the converted steps and put it into non-test project, and just add in necessary reference? If this is what u mean, we tried this before and it doesn't work. It will generate erros when trying to build the project.
So do u mean that even though we dun have VS2010 installed in build server and our tests were created in VS2010 with .NET 4.0, we will still be able to run the test in CI?

May i know what's the requirement for UI tests to run in TeamCity? If we install WebUI Test Studio Developer Edition in build server, will it run? Or we need to install Web UI Tes Studio Run Time Edition?
We can't really speak for general UI tests in TeamCity, but we can tell you about running WebAii tests in TeamCity.
You can use either the Run Time Edition or the Developer Edition. You don't need both. The Run Time Edition is meant for running tests on build servers. It contains all the components necessary for executing tests from a command line. It does not include any UI components for viewing and editing tests.
Regarding your .NET framework version problem, Visual Studio 2010 will force all Test Projects to use .NET 4. This is because they expect you to run the test using their testing framework which requires .NET 4 in that version of Visual Studio.
If you convert your WebAii tests into pure coded tests (such as NUnit) you can place them into a Class Library project in which you can switch to .NET 3.5. Visual Studio 2010 does not force Class Library projects to use a specific version of the .NET framework.
You also said "we tried this before and it doesn't work. It will generate erros when trying to build the project". What are the build errors? Perhaps we can help you with those.
Cody

Attached file is the compilation error. Am I missing any reference?
You are not missing a reference, but you are missing a file. WebUI automatically generates a pages.g.cs (or pages.g.vb for VB.NET test projects) file that includes the Pages class definition. It is generated from the elements contained in Elements Explorer and meant to be used by coded steps or coded tests like you are now creating.
Just copy that file out of the old WebAii test project and add it to your new NUnit Class Library project. That should solve this compilation error.
Cody
Let me get back to the issue we discussed in this thread:
>>I hope they can enable the multi-targeting to address this issue in a future Visual Studio release
http://blogs.msdn.com/b/vstsqualitytools/archive/2010/12/09/additional-steps-for-enabling-re-targeting-of-net-framework-in-test-projects-in-vs-2010-sp1-beta.aspx
Kind regards,
Konstantin Petkov
the Telerik team