I'm encountering an error when attempting to search for regexes within a page. I used the following to actually locate the regex, but I'm receiving various errors.
...
browser.script.html.include? "event49"
The errors seem to be browser (and possibly environment) dependent. I've tested back and forth between Safari, Chrome, and Firefox. Firefox seems to have intermittent issues. Chrome, almost constant. I've also tested this between my PC and Mac and it seems to be standard across the board.
I have no issues with Safari.
This error is from Firefox:
[remote server] resource://fxdriver/modules/web_element_cache.js:7204:in `fxdriver.cache.getElementAt': Element not found in the cache - perhaps the page has changed since it was looked up (Selenium::WebDriver::Error::StaleElementReferenceError)
This error is from Chrome:
/Library/Ruby/Gems/1.8/gems/selenium-webdriver-2.29.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok': getElementTagName execution failed; (Selenium::WebDriver::Error::StaleElementReferenceError)
Element does not exist in cache
Any help is much appreciated!
UPDATE:
Please see script below:
require "rubygems"
require "watir-webdriver"
require "watir-webdriver-performance"
require "rspec"
include Watir
require 'logger'
browser = Watir::Browser.new :chrome
test_site = 'http://laughlin:driveafirestone@fcac-rebrand.laughlin.com/'
browser.goto(test_site)
year_select = browser.select_list(:id => 'universal-year')
browser.select_list(:id => 'universal-year', :disabled => 'disabled').wait_while_present
year_select.select '2010'
make_select = browser.select_list(:id => 'universal-make')
browser.select_list(:id => 'universal-make', :disabled => 'disabled').wait_while_present
make_select.select 'Volkswagen'
model_select = browser.select_list(:id => 'universal-model')
browser.select_list(:id => 'universal-model', :disabled => 'disabled').wait_while_present
model_select.select 'Jetta'
submodel_select = browser.select_list(:id => 'universal-submodel')
browser.select_list(:id => 'universal-submodel', :disabled => 'disabled').wait_while_present
submodel_select.select '2.0T TDI Sedan'
zipcode_input = browser.text_field(:id => 'universal-selectorZip')
zipcode_input.set '53202'
browser.button(:id => 'universal-submit-tires-quote').click
browser.script.html.include? "event49"
browser.close