UI Automation test under Mac (top)

Source: Internet
Author: User
Tags sikuli

In my opinion, the process of implementing UI Automation testing has always been a happy thing, and maintaining them is just like a nightmare, especially BVT testing the build of each CI, and because development doesn't tell you any changes to the UI, the test results you get will be red. However, for projects with relatively stable interfaces, there are a number of projects required for regression testing, and a high ROI for UI Automation.

I recently implemented a UI Automation test on Mac OSX for a company product, and I'll write down the specifics below.

First, the graphical programming technology Sikuli, published by the MIT research team, is based on image retrieval, provides a set of Jython-based scripting languages, and an integrated development environment that allows users to program and interact with the GUI elements directly from the screen.

All button operations and drag operations are done with Sikuli, and like window related operations, such as non-full-screen maximization, control finder positioning to a path and so on are implemented with AppleScript, The use of Sikuli is still unstable because image recognition is used to manipulate small or control controls that are not significantly different from the surrounding image.

Sikuli not only provides a class library, but also provides an IDE, of course, its function is very simple, and often crash, so it is recommended to use it.

There is also the fact that Sikuli provides a Java package and then wraps it in Jython to make the language simpler, but it's possible that the Python library you want to use is not compatible with Jython.

Environment Preparation:

1. Installing the Java SDK

2. Download the Sikuli and visit the official website to download the jar package.

3. Install Sikuli, double-click ' Sikulixsetup-1.1.0.jar ', tick 1, 2 (Sikuli installation interface, about an open source project, is already very good)

4. After installation, an app file is generated and it is recommended to drag it to application:

5. The final execution of Sikulix.app can be

Here, the installation is over and open to the Sikuli IDE:

You can use it to make and adjust the matching degree of the picture easily.

6. Due to the use of image recognition, it is best to switch the transparency of OSX in the development and operation phase to avoid interfering with the accuracy of image recognition.

To turn off transparency in System preferences:

7. Add the required app to "accessibility" in "Security & Privacy":

Here, the environment is almost ready, of course, if you need to use the Python module, you can install get-pip.py, and then execute the install command:

  sudo pip install [module name]

UI Automation test under Mac (top)

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.