tags:

views:

85

answers:

2

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 latest try was: sel.key_press(locator, 127) and sel.key_press(locator, "\177 ") but they don't work.

What's the safest way?

A: 

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).

mamoo
A: 

Use KeyPress with '\008'

Joan