Hi Juan!

Welcome to Watir General!

Is there a javascript event associated with the calendar?  If so, you
may need to fire the event to get the selected value to stick.
Assuming it's associated with your 'a' object and the javascript event
is named 'on_select':

a.fire_event('on_select')

Hope this helps!

-Tiffany

On Dec 4, 10:13 am, juanmaflyer <[email protected]> wrote:
> Hi people! It's my first post here so let me knoe if I screwed it up
> (is screw a regular or irregular verb?)
>
> I will go directly to the grain:
>
> I'm automating some things in this websitehttp://uat.viajo.com.br/
>
> I'm trying to click a date in the calendar, the one that says 'Data de
> ida'. Ok, I can open the calendar perfectly and I also can move around
> the months, but when i want to click some specific day in order to
> select the 'Departure Date' watir seems to fail. It click it but the
> date is not written in the text-field (as it should be).
> I have try to acces the span elements in different ways but none of
> these ways helped me.
>
> Strange data: I try to print the span element and also i have flash it
> and this worked perfectly... the problem seems to be only when watir
> try to click that span element.
>
> Here is my code so far:
>
> require 'watir'
>
> ##open website
> ie = Watir::IE.start("http://uat.viajo.com.br/";)
>
> #click and open 'Data de ida' calendar
> ie.div(:class=>'mainSprite buttonCalendarOn calendarImage').click
>
> #select some specific day to set 'departure date'
> a = ie.div(:class, /lastMonth/).div(:class, "daysGrid").span(:class =>
> 'selectable', :text => '12')
>
> # this works well
> a.flash
>
> # this also works well
> puts a
>
> # this doesn't work well! the calendar window is closed after
> executing this line, but the date selected isn't written in the text-
> field
> a.click

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to