Hello All,
I have been working on trying to assert whether a date range is displayed on
screen, but have run in to problems and was hoping someone could give me some
advice. I have the dates stored in the format dd/mm/yy
I want to use a function which takes an arrival date and a departure date as
two parameters and checks against data on screen which is in the format
"arrivalDate - departureDate (x)" where x can be any number. This means that I
am going to use a Regex to try and match the parameters to part of the text on
screen, not taking in to account the last number.
def checkDates(arrDate, depDate)
myDates = arrDate + " - " + depDate
begin
assert(
$mainF.contains_text(/myDates/))
rescue => e
# Do Stuff
end
This code does not seem to be working, and I think that the reason is the date
uses "/" characters which are used to Denote a Regex expression.
If I use a constant '01/01/07 - 01/01/08' there is no problem, but I need some
way to deal with the dates in the parameters.
Does anyone have any suggestions?
Any help would be greatly appreciated.
Thanks,
PMF.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general