Login

Lost your password?
Don't have an account? Sign Up

Calendar Handling in Selenium WebDriver | Write Generic Method for Calendar – Date Picker

In this video, I have explained how to write Generic Method for Date Calendar using Selenium.

Calendar Handling in Selenium WebDriver | Write Generic Method for Calendar – Date Picker

~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Naveen AutomationLabs Paid Courses:
Java & Selenium:

Java & API +POSTMAN + RestAssured + HttpClient:

https://www.educational.guru

27 comments

  1. Tanu

    Hi, Naveen Awesome Explanation .I have small question I performed this for previous month but only one month back can we use same Generic Logic for previous date ,month, year. Thanks in advance.

  2. Swarnendu Mukherjee

    You missed the previous month/year date selection condition, having the provision to Select the previous year/month date condition is more important from tester point of view because generally we create our own test data so wrong date condition generally didn’t applied for us.

    1. Prajwal Kore

      Say we don’t want someone to select past date ,I mean today is 2 march and u don’t want someone to select march 1 and lesser dates, then we can build below logic to compare current date and date given by user

      Format formatter = new SimpleDateFormat(“dd-MMMM-yy”);
      Which ll give date in this format 02-March-2021
      And we have to construct Date object using user input using string to date formatter,using same date month format then compare them using todaysDate.isAfter(dateGivenByUser) this ll return true if user has given past date so we can add logical condition to skip our execution

      NOTE:- I didn’t execute this logic ,open for suggestions if am wrong somewhere and I ll be posting my findings after execution

  3. Lucky Raj

    Hey Naveen bro firstly Thankyou so much and as u said I have completed the assignment using goibibo and it’s working with ur method and successful. ##keep smiling and share more & more ?

  4. Govardhana K J

    How do we handle previous year calendar values (In case of providing Date of birth details).
    Example DOB : 07-02-1989
    Current calendar by default shows the current date, so I need to keep clicking on prev button and start comparing both year and month.
    Is there a generic way to handle this condition please let me know

  5. Venkatesh Ganje

    Hey Naveen. Thanks for all the vedios. Really helpful to gain in depth knowledge. Your way of explaining the concept is incredible.
    Just one doubt in this vedio of calendar handling. How to handle leap year??? Should I divide the year to be selected by 4 & use this logic to identify leap year & move further?

    Thanks in Advance. ?

  6. Aditya kaushik

    Thanks alot naveen sir.just one doubt, what if this calendar is of DOB and user wants to select sometimes past sometimes future dates dynamically?
    Great explanation sir. Thanks.
    Please reply.

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*