0

I am using Python and Selenium to fill out a form quickly. It can fill out everything except for the telephone number and credit card number. I am using

driver.find_element_by_id("order_tel").send_keys(telInfo.get())

And

driver.find_element_by_id("cnb").send_keys(numberInfo.get())

I fill out everything else the same way, and it works. The only difference with these two is that the entry form is pre-formatted. Here is a photo of the telephone entry. The same is with the credit card. I can paste into them, but the send_keys command just isn't working.

So are there any workarounds/ alternate ways to fill out this form?

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
aaaaaaaaaron_g
  • 73
  • 1
  • 2
  • 10
  • You can have a look at [THIS](http://stackoverflow.com/questions/12419339/not-able-to-input-date-using-sendkeys-in-selenium-webdriver) solution already on stackoverflow – Shah Nov 26 '15 at 22:40
  • Those do not work,I tried removing the read-only attribute but it just stops at the telephone numberr – aaaaaaaaaron_g Nov 27 '15 at 04:39
  • Can you post a link to the page? – JeffC Nov 27 '15 at 07:01

2 Answers2

0

I already encountered problem like this. I don't really know python, but I will try to put an example :

driver.execute_script("document.getElementsById('order_tel').value='myText'")

I think it should work.

Nicolas G. Duvivier
  • 498
  • 1
  • 6
  • 18
0

Perhaps you could try calling the clear() method first before sending the keys?

kntonas
  • 81
  • 1
  • 1