2 date fields being reset

0 views
Skip to first unread message

cw

unread,
Nov 18, 2009, 11:59:17 PM11/18/09
to iTest2
Hi Zhimin,

When you run the attached file, you'll see that I set 2 date values.
When I run the testcase, the dates are correctly inputed but then the
dates get set to "0".

Any ideas,

C.

text_field(:id, "HotSeason_date_sd").set("04/11/10") # This is
the start date
text_field(:id, "HotSeason_date_ed").set("09/01/10") # This is
the end date

Zhimin

unread,
Nov 19, 2009, 12:42:05 AM11/19/09
to iTest2

> When you run the attached file, you'll see that I set 2 date values.
> When I run the testcase, the dates are correctly inputed but then the
> dates get set to "0".

I think it is application-related issue, maybe some javascripts are
fired to clear these text fields. If you test the application
manually, do you get the same?

If you let me know the URL and full test scripts, I can have a look?

Zhimin

Zhimin

unread,
Nov 19, 2009, 1:05:10 AM11/19/09
to iTest2
Hi C,

The reason for setting to 0 is the menu (select tag) has onchange
event, it sets value.

A workaround as below

text_field(:id, "HotSeason_date_sd").value = "04/11/10"
text_field(:id, "HotSeason_date_sd").fire_event("onchange")
text_field(:id, "HotSeason_date_ed").value = "09/01/10"
text_field(:id, "HotSeason_date_ed").fire_event("onchange")


Zhimin

cw

unread,
Nov 19, 2009, 8:25:07 AM11/19/09
to iTest2
Hi Zhimin,

Thx for the workaround, but it didn't work. The dates still reset to
"0". It works correctly on manual input. Pls take a look at URL:
http://www.weatherbill.com/quote?type=HotSeason


Thx,

C.

Zhimin

unread,
Nov 19, 2009, 4:50:52 PM11/19/09
to iTest2
I just ran the test scripts (see below) in iTest v1.7 against Firefox
and IE, both fine

Zhimin


#---
require 'rwebspec'

specification "weather Bill Hotzone Demo" do
include RWebSpec::RSpecHelper

before(:all) do
open_browser "http://weatherbill.com"
end

scenario "get a quote " do
select_option("type", "Hot Season")
click_button("continue")
text_field(:id, "HotSeason_date_sd").value = "04/11/10"
text_field(:id, "HotSeason_date_sd").fire_event("onchange")
text_field(:id, "HotSeason_date_ed").value = "09/01/10"
text_field(:id, "HotSeason_date_ed").fire_event("onchange")
select_option("country", "USA")
# ...
end
end

Reply all
Reply to author
Forward
0 new messages