At the top of many Mozmill tests you will see a line that contains a setupModule function with something that looks like the following code in it: controller = mozmill.getBrowserController(); This creates a "controller" object for the test to use. The controller object is the heart of all Mozmill interfaces in that it allows you to completely control the application under test. However, this makes use of a global object called mozmill to instantiate the controller. The mozmill object API provides many convenience methods to help you get started testing specific applications.
Attribute | Type | Description |
---|---|---|
platform |
object | The name of the platform according to the Gecko subsystem, i.e. Mac == Darwin, Windows == winnt, linux == linux. For more specifc testing use the "is" attributes below. |
isWindows |
boolean | True if the current platform is a Windows operating system |
isLinux |
boolean | True if the current platform is a Linux operating system |
isMac |
boolean | True if the current platform is a Mac OS X operating system |
wm |
nsIWindowMediator |
Shortcut to the nsIWindowsMediator service, for an example of use see controller.MozMillController below |
appInfo |
nsIXULAppInfo |
Shortcut to the nsIXULAppInfo service. |
Gets a new browser controller for the currently open browser window. If no window is open, it opens a new window and returns a controller for that. Supported in Firefox and Seamonkey.
controller getBrowserController();
None
controller
Returns a controller object for the window.
controller = mozmill.getBrowserController();
Forces creation of a new browser window and returns a controller for it, regardless of how many other browser windows are open. Supported in Firefox and Seamonkey.
controller newBrowserController();
None
controller
Returns a controller object for the window.
controller = mozmill.newBrowserController();
Instantiates the Downloads window and returns a controller for that or returns a controller to an already opened Downloads window. Supported in Firefox and Seamonkey.
controller getDownloadsController();
None
controller
Returns a controller object for the window.
controller = mozmill.getDownloadsController();
Gets a controller for the current Thunderbird Addressbook window. If one is not open, it opens a window and returns a controller for that. Supported in Thunderbird.
controller getAddrbkController();
None
controller
Returns a controller object for the window.
controller = mozmill.getAddrbkController();
Forces the system to create a new addressbook window and returns a controller for that. Supported in Thunderbird.
controller newAddrbkController();
None
controller
Returns a controller object for the window.
controller = mozmill.newAddrbkController();
Gets a controller for the current Thunderbird window. If one is not open, it opens a window and returns a controller for that. Supported in Thunderbird.
controller getMail3PaneController();
None
controller
Returns a controller object for the window.
controller = mozmill.getMail3PaneController();
Forces the system to create a new main Thunderbird window and returns a controller for that. Supported in Thunderbird.
controller newMail3PaneController();
None
controller
Returns a controller object for the window.
controller = mozmill.newMail3PaneController();
Creates a controller for the currently open Add-Ons window, if one is not open, it opens one and returns the controller for that. Supported in all applications that use the toolkit Extension Manager to manage addons.
controller getAddonsController();
None
controller
Returns a controller object for the window.
controller = mozmill.getAddonsController();
Creates a controller for the currently open Preferences window, if one is not open, it opens one and returns the controller for that. Supported in all applications.
controller getPreferencesController();
None
controller
Returns a controller object for the window.
controller = mozmill.getPreferencesController();
Creates a controller for the given window. This works on all supported applications and allows you to create controllers for windows that do not have a convenience method above. Supported in all applications.
controller controller.MozMillController(in nsIDOMWindow
window);
window
controller
Returns a controller object for the window.
// Creates a controller for the browser's page information dialog. // It assumes that you've already clicked on the proper icons to launch the dialog. let window = mozmill.wm.getMostRecentWindow('Browser:page-info'); let pageInfoController = new mozmill.controller.MozMillController(window);