LDTP  3.5.0
 All Pages
setcursorposition

Syntax

setcursorposition('<window name>', '<text object name>', <position>)

Description

Sets cursor position in a text field

Return values
1on success, LdtpExecutionError exception on failure

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

Note
Only supported on Linux

Example

from ldtp import *

Assuming that gedit is opened

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

setcursorposition('*-gedit', 'txt0', 9)

The above example will set the given text value in first tab of gedit window and the cursor position will be moved to column number 10 of the first row.

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


Linux Desktop Testing Project