Handling calendar popup using Selenium WebDriver

0 votes

I was selecting a date from a calendar popup like 14/08/2017 from calendar using Selenium WebDrive? How to select it? Any suggestions

Below is the code I tried:

package com.Automation;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class DemoDate {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();

Apr 17, 2018 in Selenium by jack

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You are selecting wrongly your elements in your code, as you are selecting an element by id passing an xpath to the function, it should be like this:



driver.findElement(By.id(' a_2017_8_14'')).click();


You can use ID for clicking it:

driver.findElement(By.id('a_2017_8_14')).click(); //use this format a_yyyy_m_d

you can also go back or forward by clicking the calendar arrows:

driver.findElement(By.className('js_btnNext')).click() // click the "next" arrow

driver.findElement(By.className('js_btnPrev')).click() // click the "prev" arrow

note that calendar must be visible when you click the day.

answered Apr 17, 2018 by Shubham
• 12,270 points

Related Questions In Selenium

+2 votes
1 answer

How can we handle authentication popup in Selenium WebDriver using Java

The Alert Method, authenticateUsing() lets us skip ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,590 points
0 votes
1 answer

Handling pop up in Chrome using Selenium WebDriver

AutoIt Window Information Tool do not recognize ...READ MORE

answered Jun 11, 2018 in Selenium by Meci Matt
• 9,400 points
0 votes
1 answer

Click Allow on Show Notifications popup using Selenium Webdriver

Create a instance of ChromeOptions class ChromeOptions options ...READ MORE

answered Jun 20, 2018 in Selenium by Samarpit
• 5,130 points
0 votes
1 answer

Login popup window using selenium webdriver?

Follow this steps: 1) Open the FireFox browser 2) ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,400 points
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
0 votes
1 answer

Downloading *.jar file from http:// seleniumhq.org using Selenium WebDriver

For Selenium Standalone Server: profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/java-archive"); If downloading ...READ MORE

answered Apr 17, 2018 in Selenium by Shubham
• 12,270 points
0 votes
1 answer

30 min Wait on a page and then perform any Operation using Selenium Webdriver

Implicit wait tells webdriver to poll the ...READ MORE

answered Apr 19, 2018 in Selenium by Shubham
• 12,270 points

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.