Tik-76.115 Individual Project: Guinea Pig
$Id: python_interfaces.html,v 1.8 1996/04/22 08:17:49 kepa Exp $

Testee UI - Python interfaces

This document describes the Python interfaces of Testee UI. They are used to interface the Test Logic module to Testee UI. The Test Logic interface to Testee UI is designed so that the Test Logic programmer doesn't have to know about the communication protocols needed to implement the GUI modules.

The main class that hides the details of interprocess communication is called gui_client. It communicates using sockets with another class called gui_server to run the needed GUI programs on a (potentially) remote machine.

Using gui_client class

The connection to Testee GUI is impemented by gui_client class in the gui_client module. First you have to load that module. In Python it is loaded like:
   import gui_client
The module defines the gui_client class. You have to first create an instance of gui_client and initialize its connection to a gui_server process (using defaults) :
   gc = gui_client.gui_client()
   gc.connect()
The connect method will create a new gui_server process by default if the server process doesn't exist. After this you can create the gui you want with the init('guiname') method. This method takes as first parameter a string that is the name of the gui you want to use.
   ab = gc.init('ab')
Now you have an A/B test GUI object instance you can use. See the documentation index below for different GUI types and their Python interfaces. If you want to add new GUI types to Guinea Pig system, please consult: How to add new user interfaces to Guinea Pig system.

All GUI objects implement the close() method to close the GUI and cleaup after themselves. You shouldn't access the object after calling close(). Here's how you close the GUI. (Note how ab is assigned to None to enable freeing the memory it uses) :

   ab.close()
   ab = None
You can now initialize another GUI with the init() method. You can not currently have several GUI:s open at the same time.

You must close the connection to gui_server before you quit the program. This is done with the quit() method:

   gc.quit()

Documentation of test type interfaces


· Testee UI Architecture · Testee UI Index · Document index · Guinea Pig ·