私は初心者でSelenium
あり、この疑問は基本的なものかもしれません。text
デフォルト値を持つタイプの入力要素がありますが、clear
その値とinsert
新しい値が必要です。
誰か助けてもらえますか?前もって感謝します。
webdriver では clear コマンドを使用できます
@d = Selenium::WebDriver.for(:remote, :url => "http://localhost:8080/wd/hub/")
@d.navigate.to <your site>
@d.find_element(:name, "username")
@d.clear() #clears any text that was in the username field
@d.send_keys ("user") #enters the new text
コード スニペットを使用して質問を投稿すると、さらに役立ちます。とにかく、短い答え。
selenium.type("//input[@name='INPUTNAME']","NEW VALUE");