0

In my user extensions i used this code to check the date but it keeps getting errors: Selenium.prototype.doCheckDate = function(){ var dates = new Date(); var day = dates.getDate(); if (day < 10){ day = '0' + day; } month = dates.getMonth() + 1; if (month < 10){ month = '0' + month; } var year = dates.getFullYear(); var prettyDay = day + '-' + month + '-' + year; this.browserbot.getUserWindow().checkDate(prettyDay); }

The error: [error] this.browserbot.getUserWindow(...).checkDate is not a function

Does anybody have an idea how i can check the current date or dates that are in the future? Our systems fills a datefield with a date that is one or two years from the current date.

Thanks for your time and effort in advance. I appreciate it.

1 Answers1

0

It appears that all your function does is gets the current date. What is your ultimate goal? Do you intend to compare a the system date to a date from the field and verify it's 1 or 2 years later?

Klendathu
  • 793
  • 1
  • 12
  • 20
  • I want Selenium to check the current date (the system date in this case) and check if that's OK –  May 28 '15 at 09:58