Winform Automated Testing Tool Development Notes (1)

Source: Internet
Author: User
Tags script tag

Preface
It has been four months since Beijing. After the winter without heating, the brain finally turned off.
Move tomorrow to jishuitan, so that you can be closer to your work place (Sigma Building. I thought I could change my sleep habits. It seems that my effort has failed. Work in the evening. It's okay to go back to the night. You don't have to rush to the city rail to go home.
The colleagues in the group developed a winform automatic testing tool, which is quite entertaining. Let me develop one by myself. I will do it in my spare time. I will deepen my understanding of software testing, and I will improve my programming skills. I will pursue quality in both technology and art.

2006-03-22
Food first.
Today, I first found some reference materials and decided on the technology used to develop this big toy.
MATERIALS:
[1] msdn: I don't need to talk about it any more. It's an encyclopedia.
[2] programming windows 5th edition: to use Win32 programming, this book is a good reference. It has never been very nice before. Today, I sacrifice the banners.
[3] valid GUI test automation: developing an automatic ed GUI testing tool: sybex book. The content is good, and it is a bit cool. No way. There are few references. Let's take a look at it.
Technology:
As for the software itself, because it is an automatic control computer (mainly user input), it should belong to the underlying windows program development. For this underlying development, Win32 is the main path, but if Win32 is used for development, it is too difficult to write the UI-unless you write a command line program. Another option is MFC. Unfortunately, the UI is still not very easy to write. what's even worse is that MFC uses C ++ and C ++ to support xml. Why XML? Yes, automated testing? The tester needs to record the test script, execute the test script, and write the script in XML. I don't want to develop a script tag myself. C # thanks to the. NET light, the native support for XML is not bad, and writing the UI is quickly completed. Unfortunately, it is deployed on the. NET Framework's high-end platform, far from the bottom layer ...... The underlying API can only use pinvoke and memory alignment. How can the strange data types in Win32 functions be converted to. Net types? (Big head)

Technology

UI

Bottom Layer

XML

Win32

X

O

X

MFC

X

O

X

C #

O

X

O

According to the mm in the back-end group, they wrote a COM and then wrote the UI in C #. I am skeptical about this. First, what should I do if I write com? Why not write a native (unmanaged) DLL? Install COM, but it will not work if it is troublesome. Second :...... I haven't thought about it yet. Let's talk about it later.
Based on the evaluation in the above table, I still plan to use C #. Although the underlying layer is difficult to implement, it is not impossible. Write an engine and encapsulate it in a DLL assembly. That's it. The design will begin tomorrow.
By the way, add two sentences. I tried some static methods of the Process class and Form class just now to see if I can avoid pinvoke, the result shows that the value obtained by using the process instance attribute "main form handle" is indeed the same as that obtained by Win32 findwindow, unfortunately, if you use form's fromhandle to process this value, you will not be able to get the main form -- k ~~~, I'm not angry, not angry ......

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.