Monday, October 13, 2008

[Java] getClass vs instanceof

class Parent {}
class Child extends Parent {}

public class GetClassTest {
public static void main(String args[]){
Child c = new Child();
System.out.println(c instanceof Parent);
System.out.println(c.getClass().equals(Parent.class));
}
}

O/P:-
true
false

Tuesday, October 7, 2008

Interacting with Running Executables using Python

The python module "subprocess" is used for interacting with Running
Executables using python. The class name is "Popen" in python 2.5.

Ref:
1. "Module to allow Asynchronous subprocess use on Windows and Posix
platforms"
http://code.activestate.com/recipes/440554/

2. The "subprocess" python module documentation.
http://docs.python.org/lib/module-subprocess.html

Windows GUI Testing Automation

The URLs for the Windows GUI testing automation softwares are,

General:
http://www.autohotkey.com/ .

It is a free, open-source utility for Windows.
It contains the following utilities:
* AutoIt3 Window Spy - To find the controls in any application window.
* AutoScriptWriter (recorder) - To record the events which can be played back afterwards repeatedly.
* AutoHotkey Help File - To learn
AutoHotKey programming.

Python Related:
http://pywinauto.openqa.org/
Quick Demo

To use this install "Python 2.5" [ http://www.activestate.com/Products/activepython/index.mhtml (or)
http://www.activestate.com/store/productdetail.aspx?prdGuid=b08b04e0-6872-4d9d-a722-7a0c2dea2758 ]

After installing this, install the dependency module called "SendKeys" [ http://www.rutherfurd.net/python/sendkeys/index.html#binaries ] (SendKeys-0.3.win32-py2.5.exe)

Then install "pywinauto" follow the steps in "Installation" section in the web page " http://pywinauto.openqa.org/ "

Tutorial is available at http://pywinauto.openqa.org/getting_started.html , http://pywinauto.openqa.org/module-pywinauto.controls.html etc.

Followers