I have trouble understanding how to use an 'expected conditions' to check for the presence of an element. Given this documentation it is not clear at all how to use this. I have tried the following code
def _kernel_is_idle(self):
return EC.visibility_of_element_located((By.XPATH, '//*[@id="kernel_indicator_icon" and @title="Kernel Idle"]'))
with the idea of checking an element (callable as a method within a class). There are two things that do not make any sense:
According to the documentation (I had to look up the source code!), this method should return either
True
orFalse
. However, it returns the following:<selenium.webdriver.support.expected_conditions.visibility_of_element_located object at 0x110321b90>
How can this function work without a
webdriver
? Usually you always have a call likedriver.do_something()
but where is the referece to the webdriver for an 'expected condition'?