Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an application which is built using GTK+. The application has a very simple interface. When started, the same window always opens, with a few input controls.

We want to write a script to fill in text in a couple fields, check a check box, then click a button. Pretty simple, and would be easy to do if a command-line version of the app were available (but it isn't).

What's the best way to approach interacting with an X application programmatically?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Give xdotool a look. It's extremely powerful and should be able to do whatever you need.

http://www.semicomplete.com/projects/xdotool/xdotool.xhtml

share|improve this answer
    
i think the use of xdotool should only be considered in real emergency cases! Scripting something serious with xdotool is more a pain than a pleasure. Before you try xdotool ask the developer if the application has a dbus interface. That would make your plan much simpler. –  user1146332 Jul 26 '13 at 14:20
add comment

If atk/at-spi is supported/enabled for your desktop , you might want to give dogtail a try:

"...Dogtail is a GUI test tool and automation framework written in Python. It uses Accessibility (A11Y1)) technologies to communicate with desktop applications. Dogtail scripts are written in Python and executed like any other Python program..."

(an old tutorial here, just to give you an idea of how this works)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.