how to Clear or replace contents of input field using selenium?
How can i clear the contents of an input field using ruby selenium?
i.e when page loads up there are values in the input filed but i want to replace them with new开发者_JAVA技巧 ones.
thank you
Come on guys... You can't be serious...
With selenium to clear an input field do this: selenium.type("") in ruby too.
And backspacing as many times as there are letters... Come on.. you don't do stuff like that.
Or in Ruby syntax: @browser.type "idofthefield", ""
This is how i cleared and replaced with new text in my Ruby based web portal test
@driver.find_element(:xpath, "//input[@name='ip-address']").clear
@driver.find_element(:xpath, "//input[@name='ip-address']").send_keys(new_ip_address)
精彩评论