Getting the proper xpath for date picker in selenium

0 votes

I can see the below xpath exists but selenium pops up with the below error message

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="calendar-btn"]/small"}

Jul 5, 2018 in Selenium by Martin
• 4,230 points
1,808 views

1 answer to this question.

0 votes

Try to use explicit wait. Sometimes it takes time to load the element or page

from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver, 15)

date = wait.until(EC.element_to_be_clickable((By.Xpath, '//*[@id="calendarbtn"]/small")))

Try to use explicit wait. Sometimes it takes time to load the element or page

from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver, 15)

date = wait.until(EC.element_to_be_clickable((By.Xpath, '//*[@id="calendarbtn"]/small")))
answered Jul 5, 2018 by Samarpit
• 5,150 points

Related Questions In Selenium

0 votes
1 answer

XPath for the elements with no ID or Name in Selenium Webdriver

Use like this or similar to this: //div[@id="top-level-menu-item-3"]/div[@class="filter-label"] //div[@id="top-level-menu1"] ...READ MORE

answered Apr 17, 2018 in Selenium by Meci Matt
• 9,440 points
1,558 views
0 votes
1 answer

Searching for the element with   symbol in selenium

Use Below: //div[@class='Tips' and text()='\u00a0'] READ MORE

answered Apr 20, 2018 in Selenium by Vardy
• 2,270 points
1,843 views
0 votes
1 answer

what is the need of xpath when you have attributes like id ,class,name in selenium?

It is not necessary that every element ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
252 views
0 votes
1 answer

How to wait for the webpage to load in selenium using java

Firstly, when you launch a web application, ...READ MORE

answered Aug 28, 2018 in Selenium by bug_seeker
• 15,360 points
253 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,110 points
1,162 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,150 points
1,254 views
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,150 points
1,010 views
0 votes
1 answer

Maximizing the browser window in Selenium WebDriver using C#

Check this first: http://code.google.com/p/selenium/issues/detail?id=174 You Can use the JavascriptExector as follows: public ...READ MORE

answered May 2, 2018 in Selenium by Samarpit
• 5,150 points
94 views
0 votes
1 answer

Getting different texts from the HTML DOM through Selenium and Python

Try Below code: something = elem.find_element_by_xpath('./td[5]') text1 = driver.execute_script('return ...READ MORE

answered May 14, 2018 in Selenium by Samarpit
• 5,150 points
585 views