LDTP  3.5.0
 All Pages
removecallback

Syntax

removecallback('<window title>')

Description

Remove the callback function that was registered with onwindowcreate

Return values
1on success, else LdtpExecutionError exception

Refer: Linux: http://cgit.freedesktop.org/ldtp/ldtp2/tree/ldtpd/core.py

Windows: https://github.com/ldtp/cobra/blob/master/Ldtpd/WindowList.cs

Note
Supported only on Linux and Windows

Example

With respect to gedit application, replace dialog

from ldtp import *
import threading
launchapp('gedit')
waittillguiexist('*-gedit')
callbackRunning = threading.Event()
callbackRunning.clear()
callbackState = threading.Event()
callbackState.clear()
def cb():
callbackState.set()
waittillguiexist('dlgReplace')
click('dlgReplace', 'btnClose')
callbackState.clear()
callbackRunning.set()
print 'callbackend'
def cbwithvarargs(*args):
for arg in args:
print arg
print 'callbackend'
onwindowcreate('dlgReplace', cb)
onwindowcreate('dlgOpenFiles', cbwithvarargs, 'test', 'var', 'args')
click('*gedit', 'btnReplace')
click('*gedit', 'btnOpen')
waittillguiexist('dlgOpenFiles')
click('dlgOpenFiles', 'btnCancel')
if callbackState.isSet():
print 'Waiting for callback to complete'
callbackRunning.wait()
print 'callbackset'
print 'test end'
removecallback('dlgReplace')
removecallback('dlgOpenFiles')
Author
Nagappan Alagappan nagap.nosp@m.pan@.nosp@m.gmail.nosp@m..com


Linux Desktop Testing Project