Webdriver Timeout Exception
<p>I try to understand where is the problem in code:</p>

<pre><code>class WebTest(unittest.TestCase):

@classmethod
def setUpClass(cls):
    binary = FirefoxBinary('/home/andrew/Downloads/firefox 45/firefox')
    cls.browser = webdriver.Firefox(firefox_binary=binary)
    cls.wait = WebDriverWait(cls.browser, 10)
    cls.browser.maximize_window()
    cls.browser.get('http://www.test.com/')

def test_login_menu_elements(self):
    self.wait.until(EC.element_to_be_clickable((By.XPATH, "//a[@id='menu_min']"))).click() 
    check_icons(self)
    self.wait.until(EC.element_to_be_clickable((By.XPATH, "//a[@id='menu_min']"))).click() 
    check_fields(self)

def test_add_news(self):
    self.wait.until(EC.element_to_be_clickable((By.XPATH, "//span[contains(.,'News')]"))).click()
    self.wait.until(EC.element_to_be_clickable((By.XPATH, "//a[@href='/manager/news']"))).click()    

@classmethod
def tearDownClass(cls):
    cls.browser.quit()

if __name__=='__main__':
   unittest.main()
</code></pre>

<p>Every time I receive TimeoutException, and I really don't understand why, and where is the problem in the code</p>

<p>A <code>TimeoutException</code> can be received without having any logical or syntantic errors with your code.</p>

<p><code>TimeoutException</code>s will be raised when the <code>wait.until</code> expected conditions aren't found.</p>

<p>Some things I have found to help:</p>

<ul>
<li>Isolate the xpath by using chrome/firefox dev tools and right clicking on the element, and show xpath</li>
<li>Using the xpath from the step above, make sure that the condition chose is correct</li>
<li>ime having front end experience, using css selectors is usually more intuative and more understandable than relative xpaths.  </li>
<li>check the selector you are using by opening up dev tools console and using <code>$x({{ XPATH_HERE }})</code> to make sure it is valid</li>
<li>for dynamic HTML use python debugger and make sure that html is in the expected state between each expected condition</li>
</ul>

python unit-testing selenium selenium-webdriver