Here are the steps to code a UI test with Visual Studio 2013
1. New Test Project
In Visual Studio (the version I used is Update2) click on New project, File --, select " Coded UI test Project ", and in the dialog box select " Record action, Edit the UI map or add an assertion "and click ok ."
2, recorded a series of operations
After completing the above steps, vs minimized, the coded UI test builder appears:
The left-to-right button is: start/Pause recording, edit, add assertion, generate code ;
To record after:
Click "Start Recording", open the browser, and then click "Generate Code", named "Openpage";
Click "Start Recording", click on the "Video" button on the homepage (www.baidu.com), click "Generate Code", named "Clickbutton";
Click "Start Recording", close the browser, and then click "Generate Code", named "Closepage";
Close the generator, the VS2013 appears, and the generated code appears:
To open Uimap.uitest, you can edit previously recorded actions:
3. Run the test
run The test and you can see the previously recorded action, showing that the run was successful .
Coded UI test Project