Visual Studio unit test 6-UI Test

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.