bit busy at the day job this week, might be a day or two before I have time
to take a look. hopefully someone else here can have a look at this and
see if they can puzzle it out.
On Wednesday, April 4, 2012 12:19:10 AM UTC-7, sridhar249 wrote:
>
> Hi Chuck,
>
> Sorry for the late reply.
>
> I tried these 2 lines that you sent me. It is also not refreshing the
> calendar. All it does is setting the drop down option to "May"
> b.div(:id => "sideMenutimesheet_ctl00").select_list.set("May")
> b.div(:id =>
> "sideMenutimesheet_ctl00").select_list.fire_event("onchange")
>
> Here is the html of the drop down option, I don't see any javascript
> events with in the html of the drop down. Is there something else that i
> should be looking at? But in the GUI when ever i change the drop down
> option, the calendar gets refreshed.
>
> HTML of drop down option:
> ---------------------------------------
> <select><option value="1">January</option><option
> value="2">February</option><option value="3">March</option><option
> value="4" selected="selected">April</option><option
> value="5">May</option><option value="6">June</option><option
> value="7">July</option><option value="8">August</option><option
> value="9">September</option><option value="10">October</option><option
> value="11">November</option><option value="12">December</option></select>
>
> If you want to take a look at the calendar in my application, i have
> created a trial for you. You can login to it using the credentials below.
> It will only take a few seconds.
>
> Goto https://login.replicon.com/Default.aspx
> Login with CompanyKey: "a8" LoginName: "admin" Password: "password"
> Click on the timesheet tab, you will see the calendar on the left hand
> section of the page.
>
>
> On Friday, 24 February 2012 00:39:46 UTC+5:30, Chuck van der Linden wrote:
>>
>> On Feb 22, 8:25 pm, sridhar249 <[email protected]> wrote:
>> > Hi Chuck,
>> >
>> > browser.select_list(:how, 'what').fire_event('onchange') is not
>> > working. (It does not refresh the calendar)
>> >
>> > Here is my code:
>> >
>> > b.span(:id, "sideMenu").div(:id,
>> > "sideMenutimesheet_ctl00").select_list(:index, 0).set("May")
>> > sleep 5 # I don't really need this sleep. But just adding it in case
>> > it is required.
>> > b.span(:id, "sideMenu").div(:id,
>> > "sideMenutimesheet_ctl00").select_list(:index,
>> > 0).fire_event("onclick")
>> >
>> > I even tried the following fire events as well. But that did not work
>> > either.
>> >
>> > onclick, onmouseup, onmousedown, onmouseover
>> >
>> > Any other ideas?
>> >
>> >
>> (strange, thought I replied but do not see it here)
>>
>> two observations,
>> first, if ID attribute values are following spec they are unique on
>> the page, so you don't need to specify the span that holds the div if
>> you have an id for the div
>> second, if you are using newer watir (2.0+) or watir-webdriver, the
>> index 0 is the default selector.
>>
>> also note of your examples or what you say you tried is 'onchange' ..
>>
>> I'd try the following, if it does not work then please show us the
>> HTML for the select list
>>
>> b.div(:id => "sideMenutimesheet_ctl00").select_list.set("May")
>> b.div(:id =>
>> "sideMenutimesheet_ctl00").select_list.fire_event("onchange")
>>
>
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]