[Wtr-development] FireWatir: browser title bug

Bret Pettichord bret at pettichord.com
Mon Dec 29 11:04:33 EST 2008


Andrew,

Thanks for the detailed analysis. Would you mind logging this in Jira?
http://jira.openqa.org/browse/WTR

Bret


On Wed, Dec 24, 2008 at 12:12 PM, Andrew McFarlane
<welkin_inc at hotmail.com>wrote:

>  I was running a test using 1.6.2 and specifying a firefox browser (see
> full code below).  After doing a page submit, the application goes to a
> "please-be-patient" page before re-directing to the results.  I noticed that
> the value of browser.title was not correct--the value was that of the
> "please-be-patient" page instead of the results page.  However, the value of
>
> gave the correct results.
>
> Here is a condensed version of the code (I made sure that it ran):
>
> require 'rubygems'
> gem 'watir', '>=1.6.2'
> require 'watir'
>
> require 'active_support'
>
>
> Watir::Browser.default    = 'firefox'
> browser            = Watir::Browser.new
>
> # Go to the home page
> browser.goto('http://www.frontierairlines.com')
>
> # Enter the origin city code.
> elem            = browser.text_field(:id, 'flying_from')
> elem.value        = 'DEN'
> elem.focus
> elem.fire_event('onKeyDown')
> sleep 5
>
> # Select the origin city description.
> browser.li(:class, 'ui-autocomplete-even ui-autocomplete-over').click
>
> # Enter the destination city code.
> elem            = browser.text_field(:id, 'flying_to')
> elem.value        = 'LAX'
> elem.focus
> elem.fire_event('onKeyDown')
> sleep 5
>
> # Select the destination city description.
> browser.li(:class, 'ui-autocomplete-even ui-autocomplete-over').click
>
> # Enter the departure date.
> date_leave        = 1.days.from_now.strftime('%m/%d/%Y')
> browser.text_field(:id, 'leaving').value    = date_leave
>
> # Enter the return date.
> date_return        = 2.days.from_now.strftime('%m/%d/%Y')
> browser.text_field(:id, 'returning').value    = date_return
>
> # Press the 'FIND FLIGHTS' image.
> browser.image(:id, 'findFlightsButton').click
>
> sleep 30
>
> title_built_in        = browser.title
> title_js        =
> browser.js_eval(%Q(getWindows()[#{browser.instance_variable_get('@window_index')}].getBrowser().contentDocument.title))
>
> puts "Title: built in: #{title_built_in}; js version: #{title_js}"
>
>
>
> Andrew
>
>
> ------------------------------
> It's the same Hotmail(R). If by "same" you mean up to 70% faster. Get your
> account now.<http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008>
>
> _______________________________________________
> Wtr-development mailing list
> Wtr-development at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-development
>



-- 
Bret Pettichord
GTalk: bpettichord at gmail.com
CTO, WatirCraft LLC, http://www.watircraft.com
Lead Developer, Watir, http://wtr.rubyforge.org
Blog (Essays), http://www.io.com/~wazmo/blog
MiniBlog (Links), http://feeds.feedburner.com/bretshotlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wtr-development/attachments/20081229/f068361d/attachment-0002.html>


More information about the Wtr-development mailing list