Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、テキスト ボックスの値が 10 の場合、値を 20 に変更する必要があります
以下のカピバラコマンドを使用している間、
fill_in "#{ID}", :with => "20"
値は変更されません...代わりに1020として追加されます。
あなたの提案をください。
これを行うには、JavaScriptを使用する必要がありました。値を変更する前にフィールドをクリアするための別のステップを作成しました。
page.execute_script("$('#{field_id}').val('');")
正しい構文は
fill_in "ID", :with => "20"