blob: 0488ea75908343a0b21dc799df0aade2a2ecd665 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>selenium.webdriver.support.wait &mdash; Selenium 2.0 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="Selenium 2.0 documentation" href="../index.html" />
<link rel="up" title="Selenium Documentation" href="../api.html" />
<link rel="next" title="selenium.webdriver.chrome.service" href="../webdriver_chrome/selenium.webdriver.chrome.service.html" />
<link rel="prev" title="selenium.webdriver.support.select" href="selenium.webdriver.support.select.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../webdriver_chrome/selenium.webdriver.chrome.service.html" title="selenium.webdriver.chrome.service"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="selenium.webdriver.support.select.html" title="selenium.webdriver.support.select"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">Selenium 2.0 documentation</a> &raquo;</li>
<li><a href="../api.html" accesskey="U">Selenium Documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-selenium.webdriver.support.wait">
<span id="selenium-webdriver-support-wait"></span><h1>selenium.webdriver.support.wait<a class="headerlink" href="#module-selenium.webdriver.support.wait" title="Permalink to this headline"></a></h1>
<dl class="class">
<dt id="selenium.webdriver.support.wait.WebDriverWait">
<em class="property">class </em><tt class="descclassname">selenium.webdriver.support.wait.</tt><tt class="descname">WebDriverWait</tt><big>(</big><em>driver</em>, <em>timeout</em>, <em>poll_frequency=0.5</em>, <em>ignored_exceptions=None</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/wait.html#WebDriverWait"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.wait.WebDriverWait" title="Permalink to this definition"></a></dt>
<dd><p>Constructor, takes a WebDriver instance and timeout in seconds.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Args :</th><td class="field-body"><ul class="first last simple">
<li>driver - Instance of WebDriver (Ie, Firefox, Chrome or Remote)</li>
<li>timeout - Number of seconds before timing out</li>
<li>poll_frequency - sleep interval between calls
By default, it is 0.5 second.</li>
<li>ignored_exceptions - iterable structure of exception classes ignored during calls.
By default, it contains NoSuchElementException only.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="docutils">
<dt>Example:</dt>
<dd><p class="first">from selenium.webdriver.support.ui import WebDriverWait</p>
<p>element = WebDriverWait(driver, 10).until(lambda x: x.find_element_by_id(&#8220;someId&#8221;))</p>
<p>is_disappeared = WebDriverWait(driver, 30, 1, (ElementNotVisibleException)).</p>
<blockquote class="last">
<div>until_not(lambda x: x.find_element_by_id(&#8220;someId&#8221;).is_displayed())</div></blockquote>
</dd>
</dl>
<dl class="method">
<dt id="selenium.webdriver.support.wait.WebDriverWait.until">
<tt class="descname">until</tt><big>(</big><em>method</em>, <em>message=''</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/wait.html#WebDriverWait.until"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.wait.WebDriverWait.until" title="Permalink to this definition"></a></dt>
<dd><p>Calls the method provided with the driver as an argument until the return value is not False.</p>
</dd></dl>
<dl class="method">
<dt id="selenium.webdriver.support.wait.WebDriverWait.until_not">
<tt class="descname">until_not</tt><big>(</big><em>method</em>, <em>message=''</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/wait.html#WebDriverWait.until_not"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.wait.WebDriverWait.until_not" title="Permalink to this definition"></a></dt>
<dd><p>Calls the method provided with the driver as an argument until the return value is False.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="selenium.webdriver.support.select.html"
title="previous chapter">selenium.webdriver.support.select</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../webdriver_chrome/selenium.webdriver.chrome.service.html"
title="next chapter">selenium.webdriver.chrome.service</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/webdriver_support/selenium.webdriver.support.wait.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../webdriver_chrome/selenium.webdriver.chrome.service.html" title="selenium.webdriver.chrome.service"
>next</a> |</li>
<li class="right" >
<a href="selenium.webdriver.support.select.html" title="selenium.webdriver.support.select"
>previous</a> |</li>
<li><a href="../index.html">Selenium 2.0 documentation</a> &raquo;</li>
<li><a href="../api.html" >Selenium Documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011, plightbo, simon.m.stewart, hbchai, jrhuggins, et al..
</div>
</body>
</html>