help on a script for GUI

Hello all,

I need a script to automate some things (write different things in a text box, click some buttons and stuff like this) and run it several times a week. Exactly I wanna open the printing dialog from KDE , choose a printer and modify different fields in that GUI (Nr. of copies, Paper size etc.).
How can I accomplish such a thing?

Is there a framework for such things?

Thanks!

Not really sure what you’re asking here.

But I have made some calls to kmail with qdbus, so you would need to use qdbusviewer and work out the call you needed. Now I guess that the would be the correct way to use the kde framework. Another way I guess and perhaps more cli orientated would be to use lpoptions.

Novell Documentation

Command-Line Printing and Options - Documentation - CUPS

I know that i can send jobs to printer from cli but I must automate some tasks from GUI.
Is there a framework to automate some tasks made on GUI generaly (and especialy for me the printing dialog).

More general is there a tool for GUI automation testing?Because I wanna get rid of GUI manual testing if it is possible.

Yes I told you above for example here I use kmail to create the msg as I couldn’t quite figure out the direct qdbus call to make.

kmail -s "maybe this to" --msg ~/catch.txt some@addy.com;
qdbus org.kde.kmail $(qdbus org.kde.kmail | grep Comp) org.kde.kmail.mailcomposer.send 1 

So yes it is possible to interact with the gui elements, after using kmail, qdbus sends it for me. You have to do a lot of experimenting and look at some examples(Google) based around qdbus, and qdbusveiwer will come in handy.

Thanks a lot! I’ll take a look to some examples.

As I also mentioned qdbusveiwer for example for me to find out I needed to send 1 to that bit I used qdbusveiwer and monitored and navigated it, then sent it the 1.

The one thing is whilst experimenting you need to remember you need the gui open(Tech terminology here has escaped me) so that it qdbus will show it. Which is why my grep in my example(A terrible solution as it would fail on another composer window being open, well possibly send the wrong one) it was nothing more than a play, and never went further than what I’ve posted.