All pastes #38648 Raw Edit

Unnamed

public text v1 · immutable
#38648 ·published 2006-01-26 12:18 UTC
rendered paste body
def click (windowName, componentName):
        """click on radio button / check box / push button/ combo box/ radio menu item/ toggle button/ radio button.
        INPUT: click ('<window name>', '<component name>')

        OUTPUT: Clicks the component_name."""
        if not (type (windowName) == type (componentName) == types.StringType):
                raise SyntaxError
        try:
                _requestId  = str (random.randint (0, sys.maxint))
                _message = generatexml ('click', _requestId, windowName, componentName)
                sendpacket (_message)
                _responseStatus, _responseData = getresponse (_requestId)
                if _responseStatus[0] != 0:
                        raise LdtpExecutionError ('click failed')
                return 1
        except LdtpExecutionError, msg:
                raise LdtpExecutionError (str (msg))