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 in Selenium by Yashim
78 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 by Abha
• 24,980 points

Related Questions In Selenium

0 votes
1 answer
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,130 points
321 views
0 votes
1 answer

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

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,130 points
3,767 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

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

answered May 8 in Selenium by Anvi
• 13,400 points
171 views
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,090 points
768 views
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
1,011 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 in Selenium by Abha
• 24,980 points
103 views
0 votes
1 answer