The element is indeed clickable. But it is bounded with a label tag.
For more information, about binding label and info here
Using EC.element_to_be_clickable
also ensure that the element is visible which is not the case.
class element_to_be_clickable(object):
""" An Expectation for checking an element is visible and enabled such that
you can click it."""
You can confirm that it is clickable by calling is_enabled
. This method only validate that the attribute disabled
is not false.
driver.find_element_by_css_selector("input[aria-controls='pythoncode2']").is_enabled()
Or
driver.find_element_by_css_selector("input[aria-controls='pythoncode2']").get_attribute('disabled') != "true"
Result:
True
But the EC.element_to_be_clickable
also calls to is_displayed
to determine if the element is visible as well
driver.find_element_by_css_selector("input[aria-controls='pythoncode2']").is_displayed()
Result:
False
This is why, no matter how long you wait, it will never become true.
To click on the input element, you might target the label element instead. They are bound together with the attribute for=id
In your case
driver.find_element_by_css_selector('[for="tab1code2"]')
Also:
driver.find_element_by_css_selector('[for="tab1code2"]').is_enabled()
driver.find_element_by_css_selector('[for="tab1code2"]').is_displayed()
Both returns: True