Tool Review: PAMIE

Tool Review: PAMIE

PAMIE Logo

Overview:

PAMIE (Python Automation Module for I. E.) is a library, which enables Python to interact with Internet Explorer. PAMIE automates the browser by manipulating the Document Object Model (DOM) via the COM interface. PAMIE is used to create web tests written in Python using Microsoft Internet Explorer.

The review is focused on PAMIE 3.0.

Technique: Star2Star2Star2

PAMIE manipulates the DOM using Internet Explorers COM interface. Furthermore JavaScript methods can be directly called in order to start their execution. This method is similar to WatiN and shares more or less the same advantages/disadvantages.

  • Neither the browser nor the displayed web site/web application gets changed to enable interaction.
  • The native interaction enables PAMIE to read many details of the current state of the browser. For example PAMIE is able to synchronize the test with the browser.

Documentation: Star2

A documentation of PAMIE is barely available. The development for cPAMIE 2.0 stopped in 2006. So does the main project page http://pamie.sourceforge.net/. There is no information provided. Mostly you read “UNDER CONSTRUCTION!!“. The only way to get help is to search the Internet or look inside the source of the PAM30.py library which is actually good documented.

Support (Community/Commercial): Star2

Support is provided through a forum on sourceforge. The user “rmarchetti” (Rob Marchetti) is answering questions. He is also the developer.

License: Star2Star2Star2

At the moment PAMIE is distributed under no specific license. GPL is mentioned somewhere, but the developer said he will update the license to MIT soon (link to his statement).

Installation: Star2Star2

The installation of PAMIE can be quite tricky for a Python newbie. Although if you get the right files, it is pretty simple and straight forward. You should start with the basic Python installation found on the download page of the Python project. Download and install version 3.x to use PAMIE 3.0. Once installed, download and install the PyWin package (PAMIE uses this 3rd party windows extension library). If you download the version packed with the installer (pywin32-214.win32-py3.1.exe), the libraries will automatically get compiled and copied to the right Python folder. Then download the latest version of the PAMIE 3.x library from sourceforge and copy the two .py files (PAM30.py and winGuiAuto.py) into the folder “site-packages” of your Python installation. Now everything should be set up correctly to use PAMIE inside your Python scripts by importing the library.

Important: although you can often find “from cPAMIE import PAMIE” on the Internet you have to import PAMIE 3.0 by using “from PAM30 import PAMIE”.

Handling & Usability: Star2Star2

The way you develop your test scripts is up to you, because PAMIE as a library does not need a specific IDE or editor. You can use every editor you like (e.g. notepad.exe) or use your favorite IDE if a Python plugin exists (e.g. Python Plugin for Eclipse). I tried a simple but powerful Python IDE named PyScripter.

After the decision which IDE to use you can start to create your first test. PAMIE itself does not provide any further help creating tests except the method writeAttrs(). This method prints out every available input element on the current website (textfields, checkboxes, buttons, …), so you know exactly which elements can be automated with PAMIE (links are note listed by the method but PAMIE is able to click them of course).

PyScripter

Just like WatiN, your main automation object is the PAMIE object. With that you can manipulate the browser by navigating to a specific URL or clicking different links or elements of the website. So the API is very limited and focuses on the most important interaction methods. On one hand the limited functionality of PAMIE could lead to use cases which can not be implemented. But on the other hand the simplicity makes it easy for newcomers and non-developers to write tests using PAMIE and Python.

Predefined Functionality: Star2Star2

Every standard web element has its own predefined functionality for example setCheckBox() or clickButton(). The elements are defined via its id, name or value dynamically, so you can call the click button function with the name, the id or the current value of the desired button. PAMIE tries to find a button matching your parameter in the name, id or value tag. Furthermore it is possible to define the element to interact with by its numerical index. But also non standard elements are supported by the setElement() method where you are able to specify the tag and attribute in detail, which should be changed to a different value. Furthermore methods like navigate() or goBack() or validations like buttonExists() or elementExists() are also available. With executeJavaScript() it is possible to call JavaScript methods, which are included in the website.

Page synchronization is automatically done with a default timeout of 300 seconds. PAMIE highlights elements, you are interacting with, or when you read the current value of an element of the website or by using one of PAMIEs findXXX() methods.

PAMIE HighLighting

Data-Driven-Testing: Star2Star2

PAMIE on its own does only provide functionality to interact with Internet Explorer, so data-driven-testing is of course not supported out of the box. Since PAMIE is based on Pythonm, data-driven-testing could be implemented. Furthermore with PyUnit it is possible to integrate the tests in a Unit Test environment.

Compatibility: Star2Star2

It is not possible to find an official compatibility matrix of PAMIE, but after some small tests using IE6 and IE8 it looks like all major versions of Internet Explorer are supported at the moment.

Conclusion: Star2Star2

PAMIE is designed to create web test with Python using Internet Explorer and it fits this purpose. Although I would suggest other tools when web tests get a bit more complex or more browsers than Internet Explorer should be supported. If you know Python very well then stick to PAMIE, if not grab another tool.

Important links:

About the Author

klemens loschy

Klemens Loschy is member of SEQIS – The Austrian Test Experts! since 2002 and is responsible for test automation, load & performance tests, test frameworks and test tool development. Furthermore he is a student at the Technical University of Vienna (Software Engineering). He has more than 9 years experience with all kind of test software (automation and management) and programming languages (Java, SenseTalk, TSL, …).

Feel free to conctact him: klemens.loschy@seqis.com

Comments:

About these ads

Kommentar verfassen

Bitte logge dich mit einer dieser Methoden ein, um deinen Kommentar zu veröffentlichen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ photo

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

Follow

Erhalte jeden neuen Beitrag in deinen Posteingang.

%d Bloggern gefällt das: