How to Select date from a datepicker with Selenium Webdriver using Python

0 votes
How to Select date from a datepicker with Selenium Webdriver using Python?
Jul 30, 2019 in Selenium by Yashim
6,205 views

1 answer to this question.

0 votes

Hi Yashim, you can select date from a datepicker using following piece of code:

driver = webdriver.FirefoxDriver();

driver.get("http://jqueryui.com/datepicker/");

driver.switchTo().frame(0);

driver.implicitly_wait(2)
driver.maximize_window()

driver.findElement(By.id("datepicker")).click();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

dateWidget = driver.find_element_by_id("ui-datepicker-div")
rows = dateWidget.find_elements_by_tag_name("tr")
columns = dateWidget.find_elements_by_tag_name("td")

for cell in columns:
    if cell.gettext().equal('10'):
        cell.find_element_by_link_text('10').click()
        break
answered Jul 31, 2019 by Abha
• 28,000 points

Related Questions In Selenium

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,890 points
1,037 views
0 votes
2 answers

How to open a browser window in full screen using Selenium WebDriver with C#

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 5, 2020 in Selenium by Sri
• 3,010 points
11,272 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,130 points
5,179 views
0 votes
2 answers

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,520 points
4,641 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,480 views
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,890 points
3,310 views
0 votes
1 answer

How can I select date from a datepicker div using Selenium Webdriver?

Hey Jeevika, you can use following automation ...READ MORE

answered Jul 15, 2019 in Selenium by Abha
• 28,000 points
8,953 views
+1 vote
4 answers

How to get typed text from a textbox by using Selenium Webdriver?

Hey Ashmita, to get the typed text ...READ MORE

answered Jun 24, 2019 in Selenium by Abha
• 28,000 points
16,472 views