I try to input some text into a text box on a website using the automagic action "control UI". I managed to put in the text with commands
focus(x,y) and sendText(), but sometimes there is already some text in the box before, which I first must delete, in order to put in my new text into the emptied text box. I insert sleep(1000) between all commands. I tried with cut(x,y), but no joy. Also sendText("\b") does not work. I am not sure if \b is the correct escape sequence for a backslash. Where do I find a table of automagic escape sequences?
Thanks for your help.
Delete all text in a browser text input box
Moderator: Martin
Re: Delete all text in a browser text input box
Hi,
sendText does not allow to enter backspace characters. sendKey(67); or sendKey("DEL"); in a loop should work.
It should also be possible to either use function setText("abc") to replace the text in the field or by using selectAll() to select the text in the input field first and then sendText("abc") to replace the selection with your new text.
On Android 5 you could also use function setText2 to enter the text without activating the Automagic "keyboard".
Regards,
Martin
sendText does not allow to enter backspace characters. sendKey(67); or sendKey("DEL"); in a loop should work.
It should also be possible to either use function setText("abc") to replace the text in the field or by using selectAll() to select the text in the input field first and then sendText("abc") to replace the selection with your new text.
On Android 5 you could also use function setText2 to enter the text without activating the Automagic "keyboard".
Regards,
Martin
Re: Delete all text in a browser text input box
Hi Martin,
thanks for the hints. Unfortunately, they all don't help.
SetText does not simply set the text, but rather adds it to the rest which has already been in the box. It is the same with SelectAll() followed by SendText. SelectText does not select the text, but just jumps to the first position in the text box. Maybe it doesn't work on my device? It is a Samsung I9505 with CM11 M12. Any ideas?
thanks for the hints. Unfortunately, they all don't help.
SetText does not simply set the text, but rather adds it to the rest which has already been in the box. It is the same with SelectAll() followed by SendText. SelectText does not select the text, but just jumps to the first position in the text box. Maybe it doesn't work on my device? It is a Samsung I9505 with CM11 M12. Any ideas?
Re: Delete all text in a browser text input box
Hi,
Strange, maybe it's also a special 'feature' of the web browser or this text box. Browsers sometimes use their own types of text boxes that don't properly support all input features. I have to admit that I only tested using a regular text field in a regular app. This also works on CM11 in a quick test.
What site and what browser are you using?
Maybe you have to resort to the workaround and send some delete keys: for(i in [1 to 100]) {sendKey("DEL");}
Regards,
Martin
Strange, maybe it's also a special 'feature' of the web browser or this text box. Browsers sometimes use their own types of text boxes that don't properly support all input features. I have to admit that I only tested using a regular text field in a regular app. This also works on CM11 in a quick test.
What site and what browser are you using?
Maybe you have to resort to the workaround and send some delete keys: for(i in [1 to 100]) {sendKey("DEL");}
Regards,
Martin
Re: Delete all text in a browser text input box
Hi Martin, aus irgendeinem Grund funktioniert bei mir KEINER der Ansätze, auch nicht die aus den PNs. Habe es auch noch erfolglos mit longclick(x,y) probiert. Mein Workaround: Per control UI mit click auf Einstellungsmenu, aktualisieren die Seite aktualisieren, dann sind die Textfelder leer. Ideal wäre, wenn man bei der load URL in browser action optional ein Neuladen erzwingen könnte.
Danke nochmals!
Danke nochmals!