Hi <span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(68, 68, 68)">Nagappan,</span><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse"><br>
</span></font></div><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">I want to make use of <span style="font-size:13px">onwindowcreate() and removecallback() to accomplish a usage as such:</span></span></font></div>
<div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">1) I register a callback using onwindowcreate() just before I invoke a menu operation for my application under test (AUT).</span></font></div>
<div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">2) Then, I invoke the menu</span></font></div><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">2.1) If the pop-up does occur, the call back is triggered.</span></font></div>
<div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">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.</span></font></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; border-collapse: collapse; color: rgb(68, 68, 68); ">4) Perform other operations...</span></div>
<div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">5) At last, the whole test case finishes.</span></font></div><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse"><br>
</span></font></div><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse">But in my code, at step 3) I get this exceptions as below. </span></font></div>
<div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font color="#444444" face="arial, sans-serif"><span style="border-collapse:collapse"><div>
Traceback (most recent call last):</div><div> File "/usr/local/lib/python2.6/dist-packages/mago/cmd/runner.py", line 95, in run</div><div> self._run(loggerclass, setup_once)</div><div> File "/usr/local/lib/python2.6/dist-packages/mago/cmd/runner.py", line 122, in _run</div>
<div> self.suite.setup()</div><div> File "/home/qwang12/tl/src/QA/AutoTest/TestCode/guiauto/ldtpsrc/trinitylake_testsuites.py", line 78, in setup</div><div> super(BldkDefaultConfTestSuite, self).setup()</div>
<div> File "/home/qwang12/tl/src/QA/AutoTest/TestCode/guiauto/ldtpsrc/trinitylake_testsuites.py", line 26, in setup</div><div> self.application.open()</div><div> File "/home/qwang12/tl/src/QA/AutoTest/TestCode/guiauto/ldtpsrc/trinitylake.py", line 172, in open</div>
<div> ldtp.removecallback(self.UNEXPECTED_STALL_PROJECT_DLG_TITLE)</div><div> File "/var/lib/python-support/python2.6/ldtp.py", line 2019, in removecallback</div><div> _callbackFunctions [windowTitle][1].exit ()</div>
<div>AttributeError: 'int' object has no attribute 'exit'</div><div><br></div><div>I read the code in removecallback(), i save the below highlighted comments:</div><div><br></div><div><div> if _callbackFunctions.has_key (windowTitle):</div>
<div> <b># Exit last thread registered with same window title</b></div><div> _callbackFunctions [windowTitle][1].exit ()</div><div> # delete the previous instance</div><div><br></div><div>
My question is that why to "Exit last thread" in removecallback ()? </div><div><br></div><div>Thanks</div><div>Scott</div><div><br></div><div><br></div></div></span></font></div>