Unable to delete text in textbox in squish tool using python. Anyone kindly support.
d.clear() is not working, unable to clear entry in login username.need to clear all text characters in username field.
Tried delete, pop, clear, clean. Above mentioned things are not working.
d = mouseClick(waitForObject(names.main_view_login_username)
d.clear()
d.pop()
d.del()
mouseClick() does not return a reference to your GUI object. So trying to use the return value usually does not make sense.
waitForObject() returns a reference to your GUI object. That object reference (in case of Squish for Qt and Squish for Java) has the native API of the associated GUI object available. You however try to call Python functions/methods, which are not available on these GUI object references.
If the object has a property that contains the text value, assigning "" to it usually works:
Also the API of the object may offer a method to set the value:
An option that is independent of the properties and methods is to use type() or nativeType():
It should also be possible to record the desired actions, like selecting the complete contents (ideally via one key press, second best via multiple key presses, or for example via double click). Once recorded, altering/adjusting/improving the recorded script snippet is often easier.