0

when automating SFDC in chrome using selenium(python), I'm having problems entering Dates in a calender box. Instead of using a DatePick from calender, I'm sending the Dates as Send_Keys. Works for the first time, but when trying to enter in the 2nd field, it is populating both fields multiple times. For example, if I run the code the for the 3rd time, Its populating the fields with 3 instances of the date.

action.move_to_element_with_offset(em,600,209).click().send_keys("7/1/2018").perform()
action.move_to_element_with_offset(em,750,209).click().send_keys("7/1/2018").perform()

screenshots:

James Z
  • 12,209
  • 10
  • 24
  • 44
Akash Soni
  • 15
  • 3
  • 1
    You can try clearing the text while entering the dates using clear() method on the webelement – Satish Jul 17 '18 at 13:59
  • @Satish actionchains doesn't have the option clear(). Tried sending ctrl+A and backspace, that's not working too – Akash Soni Jul 17 '18 at 14:22
  • I dont know much on actions, I would assume, you will find the webelement, use the action class to move to the element in question and then perform desired actions. You can use the clear method on the webelement and not on the actions chains. If you paste the datepick html, it will be very easily to help – Satish Jul 17 '18 at 14:52
  • Why don't you just automated what can be done manually , i.e Click on first calendar select some date and then click on second date and select some date. You can make one reusable method also. – cruisepandey Jul 17 '18 at 14:58

0 Answers0