Having trouble filling a read-only text field inside an iframe? Check out the navigation steps below.
The URL is ""
Click on the "Monthly Price" button.
A text box will appear on overlay.
Having difficulty filling that text box? Here are some methods that were tried:
b.iframe(:class => "lb_iframe_pricegrid").execute_script("window.document.getElementById('actionForm_moveindate').value = '03/20/2015';")
An error was encountered:
Selenium::WebDriver::Error::JavascriptError: window.document.getElementById(...) is null
b.execute_script("window.document.getElementById('actionForm_moveindate').value = '03/20/2015';")
An error occurred:
Selenium::WebDriver::Error::JavascriptError: window.document.getElementById(...) is null
b.iframe(:class => "lb_iframe_pricegrid").text_field.set "02/20/2015"
The following error is being faced:
Watir::Exception::ObjectReadOnlyException: object is read only {:tag_name=>"input or textarea", :type=>"(any text type)"}
from /Library/Ruby/Gems/2.0.0/gems/watir-webdriver-0.6.10/lib/watir-webdriver/elements/element.rb:553:in `assert_writable'
from /Library/Ruby/Gems/2.0.0/gems/watir-webdriver-0.6.10/lib/watir-webdriver/user_editable.rb:12:in `set'
from (irb):19
from /usr/bin/irb:12:in `<main>'
Any tips or suggestions to make it work?