0

Using Selenium python,I need to enter text in Age field, but unable to achieve after trying below ways.

webdriver sendkeys method and Actions-sendkeys method doesn't work so I tried jsexecutor which performs sendkeys correctly BUT when once i complete rest of the fields on the form which includes drop-downs & textboxes, somehow the age field gets reset to default value . (This doesn't happen when form is filled manually)

self.driver.execute_script("arguments[0].value = '20'", element)

To fix above issue, I tried sending Keys.TAB using actions class after entering value in age field, but problem still persists. ActionChains(self.driver).move_to_element(element).send_keys(Keys.TAB*30).perform()

Tried sending Keys.TAB using jsexecutor as well but no luck. self.driver.execute_script(f"arguments[0].value = '\\t'", element)

Html code of the fields: <input class="form-control input-sm controlValid" type="number" value="100"> == $0

Please suggest

0 Answers0