Unit test setting file.
-
11. března 2012 17:13
Hi,
I have multiple test projects under the same solution. One project needs 64 bit host process and coded ui does not work on 64 bit ptocess,it need's 32 bit host process. Now both are using the same setting file. Could you please suggest what should be the best solution to avoid this confusion.
Všechny reakce
-
13. března 2012 9:27Moderátor
Hi ManishGupta3,
Thank you for posting in the MSDN forum.
We often do it like the following steps.
In the .testsettings, under the "Hosts" tab the drop-down menu "Run tests in 32-bit or 64-bit process:" should be selected as follows:
1). If the unit test is desired to be run as a 64-bit process, then select "Run tests in 64 bit process on 64 bit machine"
2). When we running a coded UI test, select “Force tests to run in 32 bit process”.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
- Upravený Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator 13. března 2012 9:58
-
13. března 2012 17:53
Hi Jack,
Thanks for the reply.With this method , I can't select all the test from test viewer and run it at once.So I need to select all API automation's and run it and then change it is the hosts file for coded ui tests and run it again. Doesn't seem good to me ?
Can we change the host process programetically ?
-
14. března 2012 10:08Moderátor
Hi ManishGupta3,
Glad to receive your reply.
I did some research, but I didn't find the better solution for this issue, but you could submit the suggestions and ideas: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously, thanks for your understanding.
Another workaround, we can use the MSTest to run the tests with two different testsettings, and we can use two bat files to run the two tests automatically.
Have a nice day,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
16. března 2012 2:10
Hey Jack,
Thanks for the reply.
Suppose I run the test from MSTest and not from Visual studio , in a different machine, then the current Test settings file won't work reason being we have enlistment in the previous machine(and it has relative paths w.r.t enlistment) but we don't have it in the test machine.Do you have any suggestion on how to tackle this situation.
-
19. března 2012 9:37Moderátor
Hi ManishGupta3,
Sorry for my delay.
I try to open the test settings file with Notepad, and I find that the test settings are different when we change the Host with VS,
If we select “Run tests in 64 bit process on 64 bit machine”, you will get this code:
<Execution hostProcessPlatform="MSIL">
Select “Force tests to run in 32 bit process”, it doesn’t have that code.
So we could write a test setting file, and check it.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us