The UI test is actually a process of recording operation path (mapping) and restoring the operation order by path. This method is also applicable to both winform and webform. The following uses winform as an example to describe how to record a video.
1. Create a coded UI Test
2. Select recording.
3. uimap will appear in the lower-right corner of the screen.
4. Open a winform and use the "view UI control properties" function to view the properties of the selected control.
5. Click Start recording in red and then test the winform.ProgramPerform some operations. After the operation, you can pause recording and view the recorded operation process and operation data. As shown in:
6. Click to generateCodeThe system automatically generates the following operation code.
7. re-open the winform program under test, select the generated codeduitestmethod1 method in test List editor, and execute it. The tested winform program automatically performs all the operations recorded just now.
So far, a simple winform unit test is complete. The webform recording process is the same as that of winform. Note that you must open the test website before recording. You cannot open only IE.