| |
| |
| <!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.select — 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.support.wait" href="selenium.webdriver.support.wait.html" /> |
| <link rel="prev" title="selenium.webdriver.support.expected_conditions" href="selenium.webdriver.support.expected_conditions.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="selenium.webdriver.support.wait.html" title="selenium.webdriver.support.wait" |
| accesskey="N">next</a> |</li> |
| <li class="right" > |
| <a href="selenium.webdriver.support.expected_conditions.html" title="selenium.webdriver.support.expected_conditions" |
| accesskey="P">previous</a> |</li> |
| <li><a href="../index.html">Selenium 2.0 documentation</a> »</li> |
| <li><a href="../api.html" accesskey="U">Selenium Documentation</a> »</li> |
| </ul> |
| </div> |
| |
| <div class="document"> |
| <div class="documentwrapper"> |
| <div class="bodywrapper"> |
| <div class="body"> |
| |
| <div class="section" id="module-selenium.webdriver.support.select"> |
| <span id="selenium-webdriver-support-select"></span><h1>selenium.webdriver.support.select<a class="headerlink" href="#module-selenium.webdriver.support.select" title="Permalink to this headline">¶</a></h1> |
| <dl class="class"> |
| <dt id="selenium.webdriver.support.select.Select"> |
| <em class="property">class </em><tt class="descclassname">selenium.webdriver.support.select.</tt><tt class="descname">Select</tt><big>(</big><em>webelement</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Constructor. A check is made that the given element is, indeed, a SELECT tag. If it is not, |
| then an UnexpectedTagNameException is thrown.</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>webelement - element SELECT element to wrap</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <dl class="docutils"> |
| <dt>Example:</dt> |
| <dd><p class="first">from selenium.webdriver.support.ui import Select</p> |
| <p class="last">Select(driver.find_element_by_tag_name(“select”)).select_by_index(2)</p> |
| </dd> |
| </dl> |
| <dl class="attribute"> |
| <dt id="selenium.webdriver.support.select.Select.all_selected_options"> |
| <tt class="descname">all_selected_options</tt><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.all_selected_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.all_selected_options" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Returns a list of all selected options belonging to this select tag</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.deselect_all"> |
| <tt class="descname">deselect_all</tt><big>(</big><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.deselect_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.deselect_all" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Clear all selected entries. This is only valid when the SELECT supports multiple selections. |
| throws NotImplementedError If the SELECT does not support multiple selections</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.deselect_by_index"> |
| <tt class="descname">deselect_by_index</tt><big>(</big><em>index</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.deselect_by_index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.deselect_by_index" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Deselect the option at the given index. This is done by examing the “index” attribute of an |
| element, and not merely by counting.</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>index - The option at this index will be deselected</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.deselect_by_value"> |
| <tt class="descname">deselect_by_value</tt><big>(</big><em>value</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.deselect_by_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.deselect_by_value" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Deselect all options that have a value matching the argument. That is, when given “foo” this |
| would deselect an option like:</p> |
| <blockquote> |
| <div><option value=”foo”>Bar</option></div></blockquote> |
| <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>value - The value to match against</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.deselect_by_visible_text"> |
| <tt class="descname">deselect_by_visible_text</tt><big>(</big><em>text</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.deselect_by_visible_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.deselect_by_visible_text" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Deselect all options that display text matching the argument. That is, when given “Bar” this |
| would deselect an option like:</p> |
| <p><option value=”foo”>Bar</option></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>text - The visible text to match against</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </dd></dl> |
| |
| <dl class="attribute"> |
| <dt id="selenium.webdriver.support.select.Select.first_selected_option"> |
| <tt class="descname">first_selected_option</tt><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.first_selected_option"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.first_selected_option" title="Permalink to this definition">¶</a></dt> |
| <dd><p>The first selected option in this select tag (or the currently selected option in a |
| normal select)</p> |
| </dd></dl> |
| |
| <dl class="attribute"> |
| <dt id="selenium.webdriver.support.select.Select.options"> |
| <tt class="descname">options</tt><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.options" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Returns a list of all options belonging to this select tag</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.select_by_index"> |
| <tt class="descname">select_by_index</tt><big>(</big><em>index</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.select_by_index"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.select_by_index" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Select the option at the given index. This is done by examing the “index” attribute of an |
| element, and not merely by counting.</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>index - The option at this index will be selected</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.select_by_value"> |
| <tt class="descname">select_by_value</tt><big>(</big><em>value</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.select_by_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.select_by_value" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Select all options that have a value matching the argument. That is, when given “foo” this |
| would select an option like:</p> |
| <p><option value=”foo”>Bar</option></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>value - The value to match against</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="selenium.webdriver.support.select.Select.select_by_visible_text"> |
| <tt class="descname">select_by_visible_text</tt><big>(</big><em>text</em><big>)</big><a class="reference internal" href="../_modules/selenium/webdriver/support/select.html#Select.select_by_visible_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#selenium.webdriver.support.select.Select.select_by_visible_text" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Select all options that display text matching the argument. That is, when given “Bar” this |
| would select an option like:</p> |
| <blockquote> |
| <div><option value=”foo”>Bar</option></div></blockquote> |
| <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>text - The visible text to match against</li> |
| </ul> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </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.expected_conditions.html" |
| title="previous chapter">selenium.webdriver.support.expected_conditions</a></p> |
| <h4>Next topic</h4> |
| <p class="topless"><a href="selenium.webdriver.support.wait.html" |
| title="next chapter">selenium.webdriver.support.wait</a></p> |
| <h3>This Page</h3> |
| <ul class="this-page-menu"> |
| <li><a href="../_sources/webdriver_support/selenium.webdriver.support.select.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="selenium.webdriver.support.wait.html" title="selenium.webdriver.support.wait" |
| >next</a> |</li> |
| <li class="right" > |
| <a href="selenium.webdriver.support.expected_conditions.html" title="selenium.webdriver.support.expected_conditions" |
| >previous</a> |</li> |
| <li><a href="../index.html">Selenium 2.0 documentation</a> »</li> |
| <li><a href="../api.html" >Selenium Documentation</a> »</li> |
| </ul> |
| </div> |
| <div class="footer"> |
| © Copyright 2011, plightbo, simon.m.stewart, hbchai, jrhuggins, et al.. |
| </div> |
| </body> |
| </html> |