Showing posts with label Getting the current date using the selenium:. Show all posts
Showing posts with label Getting the current date using the selenium:. Show all posts

Tuesday, 4 February 2014

Working with Dates using Selenium Webdriver

Working with the Dates : 


It is very common to work with dates in part of our automation testing,Generally we come across the following requirements:


  1. Getting  the current System date in various formats
  2. Getting the previous dates in various formats
  3. Getting the future dates in various formats
This post will make easier the things.


Steps to follow:

  1. Download the jar file from https://drive.google.com/file/d/0B9ZTXXKTZAYVUGZ5d0loWUNhMlk/edit?usp=sharing
  2. Add the ‘testUtils.jar’ (I will provide the .Jar file ) file to your project class path,    Import the following class in your Test.java file
  3.              Import com.webdriver.framework.*;     (If it’s not already imported)
  4.     Use the code as shown below :