LDTP  3.0.0
getcursorposition

Syntax

getcursorposition('<window name>', '<text object name>')

Description

Gets the current cursor position of the given text object

Return values
cursorposition which is of type long on success, LdtpExecutionError exception on failure

Refer: http://cgit.freedesktop.org/ldtp/ldtp/tree/src/text.c

Example

from ldtp import *

Assuming that gedit is opened

settextvalue('*-gedit', 'txt0', 'Testing setcursorposition function of LDTP')

getcursorposition('*-gedit', 'txt0')

The above example will get the current cursor position in the text object of gedit windows first tab.

Author
Nagappan Alagappan nagap.nosp@m.pan@.nosp@m.gmail.nosp@m..com


Linux Desktop Testing Project