I'm trying to simulate a user deleting a character from a textbox. This textbox fires many JS events, I've had much trouble typing (or typeKey-ing) in ift because of this.
My late开发者_如何学Pythonst try was: sel.key_press(locator, 127)
and sel.key_press(locator, "\177
")
but they don't work.
What's the safest way?
Use KeyPress with '\008'
I don't think that's possible with Selenium. Each modify results in a separate Type command call. So, for example, if you write "houses" and then delete the last character, it's translated with:
type(<field>, "houses")
type(<field>, "house")
with no regard of what happens at the Javascript level. If your task is to test the various methods you should use JsUnit (or FireBug).
精彩评论