Windows Automation API and automated testing

https://zhuanlan.zhihu.com/p/22083601\

Thank wheels brother thumbs up, get together over the news at the moment, it really is not a casual stroll round with a ......

The second a simple Windows Automation API test case has been updated.


Before answering a question , Could have been said that ticket query software, incidentally said a UI automated test results the comments everyone Windows how to do UI test automation with C # more interested. I wrote several articles about UI Automation, by the way can be considered a summary of these years of it. This is the first chapter, and later will be combined with code-depth explanation. His wife said writing illiterate level, we look around. If something does not speak, please indicate in the comments, thank you!

At the outset, I was talking about UI automation, but also out of process operating another program (how to do in the process, not paper coverage, non-UI automated test coverage is not in this article). For UI test automation, I am cautiously optimistic, that is prudent to choose whether to do UI test automation, automation cautious write test cases, test automation for the effect of UI is quite optimistic.

Say the top of the Windows UI test automation, we start with the underlying Windows API Let's talk about it, here do not speak very fine, first say something about, interested friends can see links to MSDN.

  • In the initial version of Windows (should be windows8 before it, if I remember correctly) is not specifically for automated testing of API (though I do not know Microsoft's initial design time, there is no for automated testing, my understanding is not) , is only one set of API's for Accessibility ( MSAA - in the Microsoft the Active Accessibility ), which is for special populations, these API functions provided by the program is to help identify the current mouse below the text, and other types of controls, to help these people use computers (such as screen readers, etc.). The US government has a standard for this, called 508 Section: https://www.section508.gov , Microsoft's controls are all standard support and implement this standard MSAA interface.
    We all know that the wisdom of the people is unlimited use of this MSAA API, people can do a lot of interesting things, not limited to the screen reader. For example, electronic dictionaries mouse to take the word translation, such as the screenshot software can identify areas of control in order to achieve accurate shots. Another example is our focus today, through this API, implement a program to control another program and to obtain control of text and status as a test verification
    for testing from the use of this API perspective, the test program is not a blind program we write program logic to help the blind to operate another program.
  • However, history is in development, with the WPF appear, MSAA in support of such a UI on stretched. Windows Automation API have emerged, this API Judging from the name you can know for Automation and design, it supports previous MSAA controls (win32 and winform), and for WPF is also very good support.

From this point of view the two sets of API, we will look at the development of automated test tools (In my tools used for):

  • The first tool is Silktest, the older of automation tools. Since With WPF, comparing it to catch anxious, various controls are not supported, can not do automated testing, until the new version supports only WPF release at least one year. Team where I first product to be tested is the WPF UI, only to give up Silktest up. In the year and there is no automated testing tools can support WPF, you may also want to understand why, because in the past all the tools are based on the MSAA, Windows Automation API we still have not begun to support.
  • Yes Silktest not supported, we do not find tools to do so only on Windows Automation API make their own set of class libraries to do this test. Behind I have time I will write some other articles, in terms of how to achieve this
  • Later TestComplete tools are also supported by the WPF, the underlying fact is the same Windows Automation API. TestComplete is to play a bit, then performance is very anxious to catch, it does not try to continue
  • Still later, a common problem is the large companies, what wants to come into the act, Microsoft itself has done a CodeUI set of class libraries, to support the creation of UI test automation Testcase. CodeUI this library really easy to use, I do not say, because we have our own library, but initially tried CodeUI, found no support for regular expression matching, also did not continue to play

Coming back section (I have only one title, and so not very busy on another one up, if you have a particular interest in the topic, I can adjust the order ......):

    • A simple Windows Automation API test case
    • UI and non-UI automated testing automated testing
    • UI Automation Test against blind
    • Application of reflection in C # UI automated testing tools
    • What is a good UI test automation
    • Outside the automated testing and automated testing processes within the process
    • Synchronization and Sleep options
    • Automated testing should begin from software design
    • Custom Controls Support Windows automation api
    • Full-time or part-time automated testing automated testing
    • Python applications in automated test
    • This talk about Qt goods
    • To talk about the UI Automation in localization testing
    • Jenkins with automated testing is based Friends
    • Vision-based automated test system Cloud
    • MacOSX platform for automated test

Guess you like

Origin www.cnblogs.com/dhcn/p/11128166.html