Start building your web presence at Rs. 499.00/mo

Start building your web presence at Rs. 499.00/mo
Web Hosting Coupon Archives

How to handle calendar in Selenium Webdriver and web table

How to handle calendar in Selenium Webdriver and web table


In my recent article I have handled web table and calendar multiple times and in this article, I will show you how you can handle calendar in Selenium Webdriver using table approach.
I will use JQuery Date picker for example and you can take any example because approach will remain same. I will be using findElements methods to find all the dates and then will get the text and will click on the respective date.

Below image is an example of Date picker which is JQuery widget
handle calendar in Selenium Webdriver

Approach to handle calendar in Selenium Webdriver


Step 1- Click on calendar
Step 2- Get all td of tables using findElements method
Step 3- using for loop get text of all elements
Step 4- using if else condition we will check specific date
Step 5- If date is matched then click and break the loop.

Program to handle calendar in Selenium Webdriver

I am using Selenium 3 in below post so in case you are completely new to Selenium 3 then check out the new firefox with Selenium 3.
SHARE

yash

  • Image
  • Image
  • Image
  • Image
  • Image

0 comments:

Post a Comment