I am trying to select all the text in a text box to clear the text box. I use Ctrl + A to do this, using the following Python 2.7 code on a standalone Selenium RC 2.20.0.jar Server on Windows 7 firefox:
from selenium import selenium s = selenium('remote-machine-ip', 4444, '*chrome', 'http://my-website-with-textbox') locator = 'mylocator-of-textbox' s.open() s.type(locator, 'mytext') s.focus(locator) s.control_key_down() s.key_down(locator, "A") s.key_press(locator, "A") s.key_up(locator, "A") s.control_key_up()
Any help? Thanks, Amit
source share