Hi,<br><br>A nice post by <a href="http://sp2hari.com/">Hari</a>, Thanks for your nice post.<br><p align="justify">Want
to use LDTP to test your application? Or do you want to automate the
actions you do often? Or are you a GNU/Linux user who want to show
"magic" to your friends by recording your actions and playing them
back? You can use LDTP for this. But one small issue with LDTP is that
you should know the LDTP Python API to write any test suite. But with
the new LDTP Editor, this makes your job really simple. A screenshot of
the LDTP Editor is shown below.</p>  <p align="center"><a href="http://sp2hari.com/wp-content/uploads/2007/11/ldtp-editor.png" title="LDTP Editor"><img src="http://sp2hari.com/wp-content/uploads/2007/11/ldtp-editor.png" alt="LDTP Editor">
</a></p>  <p align="left">This is a simple HOWTO for recording and playing back the recorded script.</p> <p align="left"><u>Installing LDTP. </u></p> <ul><li>Download the lastest LDTP source code from <a href="http://people.freedesktop.org/%7Enagappan/ldtp-0.9.2.tar.gz" title="LDTP" target="_blank">
http://people.freedesktop.org/~nagappan/ldtp-0.9.2.tar.gz</a>.</li><li>Uncompress the file.</li><li>Compile the code using ./configure and make</li><li>If you don't have the access to install softwares, run the ldtpeditor file in the python folder
</li><li>If you have access to install softwares, then run "make install"</li></ul> <p align="left">Note::  After installing LDTP Editor, i when i tried to run ldtpeditor, got an error saying</p> <p><code>hari@hari-laptop
:~/ldtp/ldtp-0.9.2$ ldtpeditor<br>(ldtpeditor:11130): libglade-WARNING **: could not find glade file &#39;/usr/share/local/ldtp/glade/ldtpeditor.glade&#39;<br>Glade file not found</code></p> <p align="left">The
ldtpeditor.glade file is present in the python folder. I got this error
because i compiled the code as ./configure. If i had done it as
'./configure ¨Cprefix=/usr', then i wouldn't have got this error. Anyway
i copied the file manually to that folder.</p> <p><code>hari@hari-laptop:~/ldtp/ldtp-0.9.2$ sudo mkdir -p /usr/share/local/ldtp/glade/<br>hari@hari-laptop:~/ldtp/ldtp-0.9.2$ sudo cp python/ldtpeditor.glade /usr/share/local/ldtp/glade/
<br>hari@hari-laptop:~/ldtp/ldtp-0.9.2$ ldtpeditor</code></p> <p>After that when i ran ldtpeditor, it ran without any issues.</p> <p><u>Recording using LDTP Editor</u></p> <p>For this let us consider recording the actions performed in gcalctool.
</p> <ul><li>First
make sure Assistive Technology is enabled in your desktop. If you are
not sure about this, open gnome-control-center and in that open
Assistive Technology Preferences. You should have Enable Assistive
Technologies checked to use LDTP.</li><li>If you are enabling Assistive Technology only now, logout and login again.</li><li>Run ldtpeditor and gcalctool.</li><li>Make sure both you have enabled 'Always on Top' or both the applications and both the window doesn't overlap with each other.
</li><li> Click the Start button the LDTP Editor. All actions performed after this are recorded.</li><li>Perform actions in the gcalctool. Check out <a href="http://download.freedesktop.org/ldtp/movies/gcalctool-record.ogg" title="Gcalctool record" target="_blank">
this video</a> to see the actions i recored in my computer .</li><li>After you're done with the actions in the gcalctool, click the Stop button in the LDTP Editor.</li><li>You can see that the 'Recorded Code' tab is updated with code as when you perform actions in gcalctool.
</li><li>Click
the convert button in the LDTP Editor. You'll see that the Generated
LDTP Code and Generated LDTP XML tabs are filled with generated code.</li><li>The Play button is not working now. I wrote the patch for that yesterday night ;-).</li><li>Save
the contents of the 'Generated LDTP Code' into a python file (for ex
frisco.py) . Note that if the file name you specify already exists,
then it OVERWRITES the filename without any warning.</li><li>Then run <code>hari@hari-laptop:~$ python frisco.py</code></li><li>The actions you performed while recording will be played back again  :-)</li></ul> <p align="justify">
Currently
the Play button in the LDTP Editor is not enabled. But you can make it
work by applying the patch mentioned below. I guess this patch will be
added to LDTP Editor in a week or so. So check the ChangeLog file
before applying the patch.</p> <p><u> LDTP Editor Preferences</u></p> <p>Using
the LDTP Prefereces, you can control what all actions you can control.
A brief summary about the options given in the Preferences window.</p> <ul><li>Listen key events<br>This option is not yet implemented. Checking/Unchecking this doesn't make any difference now.</li><li>Listen mouse events
<br>This option is not yet implemented. Checking/Unchecking this doesn't make any difference now.</li><li>Generate LDTP Code<br>Only
when if this option is enabled, Convert will generated to LDTP code in
the 'Generated LDTP Code' tab. This is enabled by default when you run
LDTP Editor.</li><li>Generate Data XML<br>If this option is enabled, the LDTP Editor will generate data XML for the actions you perform.</li><li>Generate keyboard events code<br>Generates code for the keyboard events you performed during the recording session.
</li><li>Generate wait time code<br>Calculates
the delay one takes between each action during the recording session
and generates code so that similar time delay is generated while play
back.</li><li>Generate Memory / CPU statistics.<br>The code to generate Memory and CPU statistics will be generated.  You need to install pystatgrab and libstatgrab packages.</li></ul> <p><u>Patching to make the Run button work
</u></p> <ul><li> Copy <a href="http://sp2hari.com/wp-content/uploads/2007/11/ldtpeditor_runbutton.patch" title="Run Button Patch">this</a> patch file to your ldtp folder.</li><li>Run<code>hari@hari-laptop:~/ldtp/ldtp-0.9.2$
 cd ldtp-0.9.2<br>hari@hari-laptop:~/ldtp/ldtp-0.9.2$ patch -p0 &lt;&gt;</code></li><li>Compile the code again and run ldtpeditor. This time after you Convert the Code, you can Run the code from the LDTP Editor. :-)</li></ul>
 <p>Note::
The generated code had many unwanted waittillguiexist. I saw
waittillguiexist("dlg0ˇĺ) in many places. If your playback is stopped
because of this, remove that before running the scripts.<br>Sometime the resource will go high as the application map info is collected from the application, so no need to worry.</p> <p>If you find any issues regarding LDTP Editor, report it to  
<a href="mailto:ldtp-dev@lists.freedesktop.org">ldtp-dev@lists.freedesktop.org</a>  or  <a href="mailto:nagappan@gmail.com">nagappan@gmail.com</a> or <a href="mailto:sp2hari@gmail.com">sp2hari@gmail.com</a></p> <p>All patches are welcome. :-)
</p><p><span style="font-weight: bold;">My comments</span>:<br></p><p>You can use ./configure --prefix=/usr to avoid that glade file missing warning.<br><span style="font-style: italic;"></span></p><span style="font-style: italic;">
 Additional notes</span>:<br><br>* After clicking record click &#39;Convert&#39; to get the code converted in LDTP format (It does some post processing, so its required)<br>*
Click save button to save generated python script, if 2nd tab is empty,
then it will try to get the contents of first tab and store it in the
file you specify. If file already exist, it will *OVER-WRITE*<br>* control+c, control+v doesn&#39;t work<br>*
Sometime the resource will go high as the application map info is
collected from the application, so no need to worry. With Thunderbird,
the recording really sucks<br>* You need to have GNOME 2.14 and above to use LDTP editor<br><br>Thanks<br>Nagappan<br clear="all"><br>-- <br>Linux Desktop Testing Project - <a href="http://ldtp.freedesktop.org">http://ldtp.freedesktop.org
</a><br><a href="http://nagappanal.blogspot.com">http://nagappanal.blogspot.com</a>