1

I am doing automation testing selenium with python and I got stuck here. I was unable to click on the date. Please help me to get the code to click on the date.

enter code here
    #day
    driver.find_element(By.XPATH("//span[@class='flatpickr-day' and text()='4']")).click()
    time.sleep(10)
2
  • Welcome to SO! Please provide code and details on what you already tried as well as error message, if there are any. Please also avoid posting screenshots of code/error messages etc. copy-paste those. Commented Aug 3, 2020 at 9:19
  • 1
    selenium with python, why tagging Java? Commented Aug 3, 2020 at 10:04

1 Answer 1

1

First of all, you need to get the object with needed date, you can do it using XPath:

//span[@class="flatpickr-day" and text()="4"]

This XPath will select the span with Aug 4 date

Then code this with Selenium/Java:

driver.findElement(By.xpath("//span[@class='flatpickr-day' and text()='4']")).Click();
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.