I am trying to test a HTML editor in a Cucumber scenario, and I need to simulate the user pressing backspace. The code I am using is below, but it causes the browser to navigate back instead of delete a character.
How can I focus on the editor area so that the keypress does not do this?
page.execute_script "$('.redactor-editor').first().focus();"
all('.redactor-editor')[0].native.send_key(:Backspace)
How about if you click in the text box that contains the char you want to delete prior to sending the backspace action