[LDTP-Dev] removecallback usage?

Wang Qi, Scott wangqi.s at gmail.com
Mon Nov 16 23:44:27 PST 2009


Hi Nagappan, Thanks for the quick fix and the time :)

On Tue, Nov 17, 2009 at 2:11 PM, Nagappan Alagappan <nagappan at gmail.com>wrote:

> Hi Scott,
>
> Have fixed this issue in git. Thanks for reporting this issue.
>
> Thanks
> Nagappan
>
> On Sun, Nov 15, 2009 at 2:12 AM, Wang Qi, Scott <wangqi.s at gmail.com>wrote:
>
>> Hi Nagappan,
>>
>> I want to make use of onwindowcreate() and removecallback() to accomplish
>> a usage as such:
>>
>> 1) I register a callback using onwindowcreate() just before I invoke a
>> menu operation for my application under test  (AUT).
>> 2) Then, I invoke the menu
>> 2.1) If the pop-up does occur, the call back is triggered.
>> 3) After the menu operations, I remove the callback using removecallback
>> (). As the pop-up has a quite generic name, the action in the callback is
>> only meant to be valid for this particular menu.
>> 4) Perform other operations...
>> 5) At last, the whole test case finishes.
>>
>> But in my code, at step 3) I get this exceptions as below.
>>
>> Traceback (most recent call last):
>>   File "/usr/local/lib/python2.6/dist-packages/mago/cmd/runner.py", line
>> 95, in run
>>     self._run(loggerclass, setup_once)
>>   File "/usr/local/lib/python2.6/dist-packages/mago/cmd/runner.py", line
>> 122, in _run
>>     self.suite.setup()
>>   File
>> "/home/qwang12/tl/src/QA/AutoTest/TestCode/guiauto/ldtpsrc/trinitylake_testsuites.py",
>> line 78, in setup
>>     super(BldkDefaultConfTestSuite, self).setup()
>>   File
>> "/home/qwang12/tl/src/QA/AutoTest/TestCode/guiauto/ldtpsrc/trinitylake_testsuites.py",
>> line 26, in setup
>>     self.application.open()
>>   File
>> "/home/qwang12/tl/src/QA/AutoTest/TestCode/guiauto/ldtpsrc/trinitylake.py",
>> line 172, in open
>>     ldtp.removecallback(self.UNEXPECTED_STALL_PROJECT_DLG_TITLE)
>>   File "/var/lib/python-support/python2.6/ldtp.py", line 2019, in
>> removecallback
>>     _callbackFunctions [windowTitle][1].exit ()
>> AttributeError: 'int' object has no attribute 'exit'
>>
>> I read the code in removecallback(), i save the below highlighted
>> comments:
>>
>>         if _callbackFunctions.has_key (windowTitle):
>>             *# Exit last thread registered with same window title*
>>             _callbackFunctions [windowTitle][1].exit ()
>>             # delete the previous instance
>>
>> My question is that why to "Exit last thread" in removecallback ()?
>>
>> Thanks
>> Scott
>>
>>
>>
>> _______________________________________________
>> LDTP-dev mailing list
>> LDTP-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
>>
>>
>
>
> --
> Linux Desktop (GUI Application) Testing Project -
> http://ldtp.freedesktop.org
> http://nagappanal.blogspot.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/ldtp-dev/attachments/20091117/52f06e81/attachment.html 


More information about the LDTP-dev mailing list