UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

18 lines 4.73 kB
<!DOCTYPE html><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>bot.response</title><link href="dossier.css" rel="stylesheet" type="text/css"><header><div><form><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></header><main><article><div class="codelink"><a href="source/lib/atoms/response.js.src.html#l23">View Source</a></div><h1>namespace bot.response</h1><h2>Functions</h2><div id="checkResponse" class="function"><div><h3>checkResponse(<wbr>responseObj)<span class="codelink"><a href="source/lib/atoms/response.js.src.html#l95">code »</a></span></h3><p>Checks that a response object does not specify an error as defined by the WebDriver wire protocol. If the response object defines an error, it will be thrown. Otherwise, the response will be returned as is.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>responseObj<code>{status: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, value: *}</code><dd><p>The response object to check.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{status: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, value: *}</code><dd><p>The checked response object.</p> </dl></div><div class="fn-details"><div><b>Throws</b></div><dl><dt><code><a href="class_bot_Error.html">bot.Error</a></code><dd><p>If the response describes an error.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="createErrorResponse" class="function"><div><h3>createErrorResponse(<wbr>error)<span class="codelink"><a href="source/lib/atoms/response.js.src.html#l69">code »</a></span></h3><p>Converts an error value into its JSON representation as defined by the WebDriver wire protocol.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>error<code>*</code><dd><p>The error value to convert.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{status: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, value: *}</code><dd><p>The new response object.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="createResponse" class="function"><div><h3>createResponse(<wbr>value)<span class="codelink"><a href="source/lib/atoms/response.js.src.html#l52">code »</a></span></h3><p>Creates a new success response object with the provided value.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>value<code>*</code><dd><p>The response value.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code>{status: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, value: *}</code><dd><p>The new response object.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="isResponseObject" class="function"><div><h3>isResponseObject(<wbr>value)<span class="codelink"><a href="source/lib/atoms/response.js.src.html#l42">code »</a></span></h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>value<code>*</code><dd><p>The value to test.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>Whether the given value is a response object.</p> </dl></div></div></div></div><h2>Type Definitions</h2><div id="response.ResponseObject" class="property"><dl><dt><a href="source/lib/atoms/response.js.src.html#l35">response.ResponseObject</a><code>{status: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, value: *}</code><dd><p>Type definition for a response object, as defined by the JSON wire protocol.</p> </dl></div></article><nav><h3><a href="index.html" tabindex="2">Overview</a></h3><div><input type="checkbox" id="nav-modules" checked/><label for="nav-modules"><h3><span class="selectable" tabindex="2">Modules</span></h3></label><div id="nav-modules-view"></div></div><div><input type="checkbox" id="nav-types" checked/><label for="nav-types"><h3><span class="selectable" tabindex="2">Types</span></h3></label><div id="nav-types-view"></div></div><h3><a href="Changes.html" tabindex="2">Changes</a></h3></nav></main><footer><div><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></div></footer><script src="types.js"></script><script src="dossier.js"></script>