just_add_watir | Advanced recipes for Watir
12Aug/08Off

Q. How do I simulate a user pressing other keys?

A. Use the .send_keys method ...
A complete list of send_keys combinations is available here.
Example watir:

@b.goto("http://www.google.com")
@b.text_field(:name, 'q').set('foobar')
@b.send_keys("{TAB}")
@b.send_keys("{TAB}")
@b.send_keys("+{TAB}")
@b.send_keys("{SPACE}")
Comments (1) Trackbacks (0)
  1. Why doesn’t the send_keys method not work with Vista?

Trackbacks are disabled.