Is there a way of running CodedUI steps outside a test project?
I want to use them to automate some actions in an application.
Is there a way of running CodedUI steps outside a test project?
I want to use them to automate some actions in an application.
The program mstest.exe
can be used to invoke Coded UI tests. Its /test:{test name}
option allows a specific test (ie activity) to be executed, thus several different activities (ie tests) to be combined into one source file but only the desired activity is executed. Calling mstest.exe
from a batch or Powershell script allows the activity to be executed without needing to type a long command each time.
If you already use Coded UI then there is no reason why it cannot be used for automating a series of GUI actions.
An example: For one project we needed to set a database from a backup before each series of tests. Manually that took 5 minutes and sometimes we did it wrong and so wasted time. With Coded UI it always worked and it ran quickly.
There's a significant amount of overhead involved in coded ui that you may not need in your automation task. To execute a coded ui test (and therefore run your automation), you'll need a full Visual Studio Professional or Test Controller/Test Agent installed on every machine that will be running the test/automation, and the machine will have to have a UI that is always available, I.E., a virtual machine configured so the desktop is always available and will not have interactions from another user.
Since your question was rather vague about what you want to automate, I can't really suggest anything in place of Coded UI, but it should be enough to say that you should use the tool that's best suited for the job at hand. Sure, you could use it to run your automation, but why would you want to? (insert imagery of a Corvette pulling a camper here)