3

I'm having an issue with the Selenium2Library "Input Text" keyword due to a couple of new text fields that have an auto-formatting script that appear to be causing issues when entering text with the keyword (there are spaces added into the text after a certain number of keystrokes, which is causing the expected text string to not be properly entered). I tried numerous ways to get this keyword to work, such as inputting a delay between the text field entries, formatting the strings that I'm trying to have Input Text enter, but unfortunately nothing has worked yet.

I'm writing this question to see if anybody has had any luck with a workaround to using the Input Text command. I am trying to think of some other options, and it seems that copying/pasting the text into the text field may work, as I was able to copy/paste effectively into these text fields when I was troubleshooting the fields manually, however I couldn't find a copy/paste keyword in any of the libraries I looked in. Or perhaps a Javascript command would be possible for this?

Does anybody have any ideas of how to alternatively enter text into a text field other than Selenium2Library's "Input Text" keyword?

Thank you.

chmc
  • 265
  • 1
  • 5
  • 12
  • 2
    Try `Press Key` keyword http://robotframework.org/Selenium2Library/doc/Selenium2Library.html#Press%20Key. – jim May 13 '16 at 05:16
  • Thank you, I was able to use this to get the problem resolved! It seems that Input Text was entering the text too quickly for the text field. With "Press Key" keyword, I was able to input a very slight delay at certain points while entering the text into the field. If you would like to move your comment into an answer, I would select it as an accepted answer. – chmc May 13 '16 at 06:28
  • Thanks. Posted an answer for you. – jim May 13 '16 at 07:53

1 Answers1

4

Press Key keyword can solve your problem. You can either put your whole string in one keyword or put characters separately gaining an opportunity to slow down your input.

jim
  • 906
  • 7
  • 14