So I want to use format to manipulate with timepicker in selenium python.
I have following variable:
time = Element('xpath=//li[contains(text(),"{}:{} PM")]')
And then I try to use format to located the element:
def select_ten_thirty_time(self):
self.time_picker.wait_element_to_be_clickable().click()
self.time.format(10, 30).wait_element_to_be_clickable().click()
But I get this error:
selenium.common.exceptions.NoSuchElementException: \
Message: Unable to locate element: //li[contains(text(),"{}:{} PM")]
EDIT => Added HTML
<li class="react-datepicker__time-list-item
react-datepicker__time-list-item--selected">10:30 PM</li>
Thank you for your help!