0

I am using selenium web driver to automate front end web UI actions in Python script. In this regard to input value to a text filed (mandatory field), driver.find_element_by_xpath(<xpath>).send_keys(<value>) code is used.

Though I am able to see that value has been typed in the concerned text field, an error message saying text box cannot be empty is being thrown on the UI.

Browser : 23.0 (Also tried with old version like 20.0, 16.0 which reproduces same issue) Python Version : 2.7

Here is my code:

sel = webdriver.Firefox()
sel.find_element_by_xpath("//input[@name='minBid']")'.send_keys("2") 
sel.find_element_by_xpath("//div[text()='Save']")

Upon running this snippet, UI complaints saying min bid is not supplied.

Please help solve this challenge. Thank you.

3
  • share the code with us... Commented Aug 28, 2013 at 10:02
  • How does the UI get the value from the field? Commented Aug 28, 2013 at 10:12
  • Here is the code snippet: ' sel = webdriver.Firefox() sel.find_element_by_xpath("//input[@name='minBid']")'.send_keys("2") sel.find_element_by_xpath("//div[text()='Save']")' Upon running this snippet, UI complaints sayin min bid is not supplied Commented Aug 28, 2013 at 10:23

1 Answer 1

2

Try clicking on the field before input;

sel.find_element_by_xpath("//input[@name='minBid']")'.click
sel.find_element_by_xpath("//input[@name='minBid']")'.send_keys("2") 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.