-1

I want to send data to a text field in html page using selenium python .Is there any method other than send_keys() using python-selenium?

S42
  • 9
  • 2
  • Why don't you want to use `send_keys()`? – Bryan Oakley Nov 13 '16 at 13:54
  • Please read [ask]. Please provide the code you have tried and the execution result including any error messages, etc. Also provide a link to the page and/or the relevant HTML. – JeffC Nov 13 '16 at 22:06

1 Answers1

2

Assuming Windows, you can try using Pywinauto which uses Microsoft's UIAutomation and has access to sending keys to windows and dialogs, e.g.

driver = webdriver.Firefox()
elem = driver.find_element_by_name('j_username')
elem.clear()
app = Application.Application()
app.window_(title_re='*.Firefox.*').TypeKeys('username')
Moshisho
  • 2,781
  • 1
  • 23
  • 39