Skip to content

Commit

Permalink
Updating Python docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Sep 9, 2014
1 parent 2a51484 commit a017fb7
Show file tree
Hide file tree
Showing 24 changed files with 552 additions and 487 deletions.
7 changes: 6 additions & 1 deletion docs/api/py/_modules/selenium/common/exceptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ <h1>Source code for selenium.common.exceptions</h1><div class="highlight"><pre>
<span class="sd"> Usually raised when when an expected modal is blocking webdriver form executing any </span>
<span class="sd"> more commands.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">pass</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">screen</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stacktrace</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">alert_text</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">WebDriverException</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="n">screen</span><span class="p">,</span> <span class="n">stacktrace</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">alert_text</span> <span class="o">=</span> <span class="n">alert_text</span>

<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="s">&quot;Alert Text: </span><span class="si">%s</span><span class="se">\n</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">alert_text</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="nb">super</span><span class="p">(</span><span class="n">WebDriverException</span><span class="p">,</span> <span class="bp">self</span><span class="p">)))</span>
</div>
<div class="viewcode-block" id="NoAlertPresentException"><a class="viewcode-back" href="../../../common/selenium.common.exceptions.html#selenium.common.exceptions.NoAlertPresentException">[docs]</a><span class="k">class</span> <span class="nc">NoAlertPresentException</span><span class="p">(</span><span class="n">WebDriverException</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
Expand Down
819 changes: 412 additions & 407 deletions docs/api/py/_modules/selenium/selenium.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/api/py/_modules/selenium/webdriver/chrome/webdriver.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ <h1>Source code for selenium.webdriver.chrome.webdriver</h1><div class="highligh
<span class="sd"> - chrome_options: this takes an instance of ChromeOptions</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">chrome_options</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">options</span> <span class="o">=</span> <span class="n">Options</span><span class="p">()</span>
<span class="c"># desired_capabilities stays as passed in</span>
<span class="k">if</span> <span class="n">desired_capabilities</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">desired_capabilities</span> <span class="o">=</span> <span class="n">Options</span><span class="p">()</span><span class="o">.</span><span class="n">to_capabilities</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">options</span> <span class="o">=</span> <span class="n">chrome_options</span>

<span class="k">if</span> <span class="n">desired_capabilities</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">desired_capabilities</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">options</span><span class="o">.</span><span class="n">to_capabilities</span><span class="p">())</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">desired_capabilities</span> <span class="o">=</span> <span class="n">options</span><span class="o">.</span><span class="n">to_capabilities</span><span class="p">()</span>
<span class="k">if</span> <span class="n">desired_capabilities</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="n">desired_capabilities</span> <span class="o">=</span> <span class="n">chrome_options</span><span class="o">.</span><span class="n">to_capabilities</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">desired_capabilities</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">chrome_options</span><span class="o">.</span><span class="n">to_capabilities</span><span class="p">())</span>

<span class="bp">self</span><span class="o">.</span><span class="n">service</span> <span class="o">=</span> <span class="n">Service</span><span class="p">(</span><span class="n">executable_path</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="n">port</span><span class="p">,</span>
<span class="n">service_args</span><span class="o">=</span><span class="n">service_args</span><span class="p">,</span> <span class="n">log_path</span><span class="o">=</span><span class="n">service_log_path</span><span class="p">)</span>
Expand All @@ -114,7 +114,7 @@ <h1>Source code for selenium.webdriver.chrome.webdriver</h1><div class="highligh
<span class="n">keep_alive</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="k">except</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">quit</span><span class="p">()</span>
<span class="k">raise</span>
<span class="k">raise</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_is_remote</span> <span class="o">=</span> <span class="bp">False</span>

<div class="viewcode-block" id="WebDriver.quit"><a class="viewcode-back" href="../../../../webdriver_chrome/selenium.webdriver.chrome.webdriver.html#selenium.webdriver.chrome.webdriver.WebDriver.quit">[docs]</a> <span class="k">def</span> <span class="nf">quit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/py/_modules/selenium/webdriver/common/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h1>Source code for selenium.webdriver.common.utils</h1><div class="highlight"><
<span class="k">try</span><span class="p">:</span>
<span class="n">socket_</span> <span class="o">=</span> <span class="n">socket</span><span class="o">.</span><span class="n">socket</span><span class="p">(</span><span class="n">socket</span><span class="o">.</span><span class="n">AF_INET</span><span class="p">,</span> <span class="n">socket</span><span class="o">.</span><span class="n">SOCK_STREAM</span><span class="p">)</span>
<span class="n">socket_</span><span class="o">.</span><span class="n">settimeout</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">socket_</span><span class="o">.</span><span class="n">connect</span><span class="p">((</span><span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="n">port</span><span class="p">))</span>
<span class="n">socket_</span><span class="o">.</span><span class="n">connect</span><span class="p">((</span><span class="s">&quot;127.0.0.1&quot;</span><span class="p">,</span> <span class="n">port</span><span class="p">))</span>
<span class="n">socket_</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">return</span> <span class="bp">True</span>
<span class="k">except</span> <span class="n">socket</span><span class="o">.</span><span class="n">error</span><span class="p">:</span>
Expand All @@ -109,7 +109,7 @@ <h1>Source code for selenium.webdriver.common.utils</h1><div class="highlight"><
<span class="kn">import</span> <span class="nn">urllib2</span> <span class="kn">as</span> <span class="nn">url_request</span>

<span class="k">try</span><span class="p">:</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">url_request</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="s">&quot;http://localhost:</span><span class="si">%s</span><span class="s">/status&quot;</span> <span class="o">%</span> <span class="n">port</span><span class="p">)</span>
<span class="n">res</span> <span class="o">=</span> <span class="n">url_request</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="s">&quot;http://127.0.0.1:</span><span class="si">%s</span><span class="s">/status&quot;</span> <span class="o">%</span> <span class="n">port</span><span class="p">)</span>
<span class="k">if</span> <span class="n">res</span><span class="o">.</span><span class="n">getcode</span><span class="p">()</span> <span class="o">==</span> <span class="mi">200</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">True</span>
<span class="k">else</span><span class="p">:</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h1>Source code for selenium.webdriver.firefox.firefox_binary</h1><div class="hi

<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">platform</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">PIPE</span><span class="p">,</span> <span class="n">STDOUT</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">STDOUT</span>
<span class="kn">from</span> <span class="nn">selenium.common.exceptions</span> <span class="kn">import</span> <span class="n">WebDriverException</span>
<span class="kn">from</span> <span class="nn">selenium.webdriver.common</span> <span class="kn">import</span> <span class="n">utils</span>
<span class="kn">import</span> <span class="nn">time</span>
Expand All @@ -83,13 +83,16 @@ <h1>Source code for selenium.webdriver.firefox.firefox_binary</h1><div class="hi
<span class="sd"> - firefox_path - Path to the Firefox executable. By default, it will be detected from the standard locations.</span>
<span class="sd"> - log_file - A file object to redirect the firefox process output to. It can be sys.stdout.</span>
<span class="sd"> Please note that with parallel run the output won&#39;t be synchronous.</span>
<span class="sd"> By default, it will be redirected to subprocess.PIPE.</span>
<span class="sd"> By default, it will be redirected to /dev/null.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_start_cmd</span> <span class="o">=</span> <span class="n">firefox_path</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_log_file</span> <span class="o">=</span> <span class="n">log_file</span> <span class="ow">or</span> <span class="n">PIPE</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_log_file</span> <span class="o">=</span> <span class="n">log_file</span> <span class="ow">or</span> <span class="nb">open</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">devnull</span><span class="p">,</span> <span class="s">&quot;wb&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">command_line</span> <span class="o">=</span> <span class="bp">None</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_start_cmd</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_start_cmd</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_firefox_start_cmd</span><span class="p">()</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_start_cmd</span><span class="o">.</span><span class="n">strip</span><span class="p">():</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s">&quot;Failed to find firefox binary. You can set it by specifying the path to &#39;firefox_binary&#39;:</span><span class="se">\n\n</span><span class="s">from selenium.webdriver.firefox.firefox_binary import FirefoxBinary</span><span class="se">\n\n</span><span class="s">&quot;</span> <span class="o">+</span>
<span class="s">&quot;binary = FirefoxBinary(&#39;/path/to/binary&#39;)</span><span class="se">\n</span><span class="s">driver = webdriver.Firefox(firefox_binary=binary)&quot;</span><span class="p">)</span>
<span class="c"># Rather than modifying the environment of the calling Python process</span>
<span class="c"># copy it and modify as needed.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_firefox_env</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
Expand Down Expand Up @@ -158,9 +161,9 @@ <h1>Source code for selenium.webdriver.firefox.firefox_binary</h1><div class="hi

<span class="k">def</span> <span class="nf">_find_exe_in_registry</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">_winreg</span> <span class="kn">import</span> <span class="n">OpenKey</span><span class="p">,</span> <span class="n">QueryValue</span><span class="p">,</span> <span class="n">HKEY_LOCAL_MACHINE</span>
<span class="kn">from</span> <span class="nn">_winreg</span> <span class="kn">import</span> <span class="n">OpenKey</span><span class="p">,</span> <span class="n">QueryValue</span><span class="p">,</span> <span class="n">HKEY_LOCAL_MACHINE</span><span class="p">,</span> <span class="n">HKEY_CURRENT_USER</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">winreg</span> <span class="kn">import</span> <span class="n">OpenKey</span><span class="p">,</span> <span class="n">QueryValue</span><span class="p">,</span> <span class="n">HKEY_LOCAL_MACHINE</span>
<span class="kn">from</span> <span class="nn">winreg</span> <span class="kn">import</span> <span class="n">OpenKey</span><span class="p">,</span> <span class="n">QueryValue</span><span class="p">,</span> <span class="n">HKEY_LOCAL_MACHINE</span><span class="p">,</span> <span class="n">HKEY_CURRENT_USER</span>
<span class="kn">import</span> <span class="nn">shlex</span>
<span class="n">keys</span> <span class="o">=</span> <span class="p">(</span>
<span class="s">r&quot;SOFTWARE\Classes\FirefoxHTML\shell\open\command&quot;</span><span class="p">,</span>
Expand All @@ -173,7 +176,12 @@ <h1>Source code for selenium.webdriver.firefox.firefox_binary</h1><div class="hi
<span class="n">command</span> <span class="o">=</span> <span class="n">QueryValue</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span>
<span class="k">break</span>
<span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span>
<span class="k">pass</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">key</span> <span class="o">=</span> <span class="n">OpenKey</span><span class="p">(</span><span class="n">HKEY_CURRENT_USER</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span>
<span class="n">command</span> <span class="o">=</span> <span class="n">QueryValue</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span>
<span class="k">break</span>
<span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span>
<span class="k">pass</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s">&quot;&quot;</span>

Expand Down
1 change: 0 additions & 1 deletion docs/api/py/_modules/selenium/webdriver/opera/service.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ <h1>Source code for selenium.webdriver.opera.service</h1><div class="highlight">
<span class="c"># See the License for the specific language governing permissions and</span>
<span class="c"># limitations under the License.</span>
<span class="kn">import</span> <span class="nn">subprocess</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">PIPE</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">selenium.common.exceptions</span> <span class="kn">import</span> <span class="n">WebDriverException</span>
<span class="kn">from</span> <span class="nn">selenium.webdriver.common</span> <span class="kn">import</span> <span class="n">utils</span>
Expand Down
3 changes: 2 additions & 1 deletion docs/api/py/_modules/selenium/webdriver/remote/command.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h1>Source code for selenium.webdriver.remote.command</h1><div class="highlight"
<span class="sd"> While these constants have no meaning in and of themselves, they are</span>
<span class="sd"> used to marshal commands through a service that implements WebDriver&#39;s</span>
<span class="sd"> remote wire protocol:</span>
<span class="sd"> </span>

<span class="sd"> http://code.google.com/p/selenium/wiki/JsonWireProtocol</span>
<span class="sd"> &quot;&quot;&quot;</span>

Expand Down Expand Up @@ -124,6 +124,7 @@ <h1>Source code for selenium.webdriver.remote.command</h1><div class="highlight"
<span class="n">GET_ELEMENT_LOCATION</span> <span class="o">=</span> <span class="s">&quot;getElementLocation&quot;</span>
<span class="n">GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW</span> <span class="o">=</span> <span class="s">&quot;getElementLocationOnceScrolledIntoView&quot;</span>
<span class="n">GET_ELEMENT_SIZE</span> <span class="o">=</span> <span class="s">&quot;getElementSize&quot;</span>
<span class="n">GET_ELEMENT_RECT</span> <span class="o">=</span> <span class="s">&quot;getElementRect&quot;</span>
<span class="n">GET_ELEMENT_ATTRIBUTE</span> <span class="o">=</span> <span class="s">&quot;getElementAttribute&quot;</span>
<span class="n">GET_ELEMENT_VALUE_OF_CSS_PROPERTY</span> <span class="o">=</span> <span class="s">&quot;getElementValueOfCssProperty&quot;</span>
<span class="n">ELEMENT_EQUALS</span> <span class="o">=</span> <span class="s">&quot;elementEquals&quot;</span>
Expand Down
Loading

0 comments on commit a017fb7

Please sign in to comment.