Python-based framework for functional testing

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Final Word

Autopilot offers many features beyond what I've described in this article, features such as keybinding support, helpers for property assertions, multi-monitor support, and others. Additionally, Autopilot has been tested to run on ARM devices, so potentially it can be used for testing Python-enabled mobile devices. Development still continues and is open to all user contributions. So, get ready and start testing your applications right away!

Table 1

Common Autopilot Test Control Functions

Function Description
self.keyboard.type("String") Type in the given string one character at a time.
self.keyboard.press_and_release("Ctrl+a") Press a given key combination in the given order and then release them in the opposite; modifiers such as Ctrl, Shift, Alt, Super, etc. can be used.
self.mouse.move(x, y) Move mouse to the x and y position on screen.
self.mouse.click(button) Click with the mouse at the current mouse position; optionally, an additional button parameter can be provided, defining the button used.
self.mouse.press(button) Press the mouse button.
self.mouse.release(button) Release the mouse button.
self.mouse.move_to_object(button) For many objects, using the convenient method of moving the mouse to a selected object is also possible.
self.start_app(application_name) Starts an application of the given name. The started application first must be registered as a known application; Autopilot defines some by default. After starting, a cleanup routine for the started application is automatically prepared, closing all application windows after the test.
self.start_app_window(application_name) The same as self.start_app() , but the cleanup routine only closes the single window that has been opened.
self.register_known_application(name, desktop_file_name, process_name) Registers an application for future opening through self.start_app() .

The Author

Lukasz Zemczak is a software engineer working for Canonical Ltd. on Ubuntu-related projects. He is part of the Product Strategy integration team currently focusing on the Unity user interface stack support and maintenance. His interests include operating system design, usability topics, and embedded systems.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content