Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions theserenitybook/latest/page-objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -954,20 +954,23 @@ <h2 id="_executing_javascript"><a class="anchor" href="#_executing_javascript"><
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java"> evaluateJavascript("document.getElementById('firstname').focus()");</code></pre>
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">evaluateJavascript("document.getElementById('firstname').focus()");</code></pre>
</div>
</div>
<div class="paragraph">
<p>And, if you are familiar with JQuery, you can also invoke JQuery expressions:</p>
<p>And, if you are familiar with JQuery, you can also invoke JQuery expressions, as Serenity will automatically inject a bundled version of JQuery into each page, unless the page already includes it:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java"> evaluateJavascript("$('#firstname').focus()");</code></pre>
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">evaluateJavascript("$('#firstname').focus()");</code></pre>
</div>
</div>
<div class="paragraph">
<p>This is often a useful strategy if you need to trigger events such as mouse-overs that are not currently supported by the WebDriver API.</p>
</div>
<div class="paragraph">
<p>You can disable the injection of JQuery by setting <code>serenity.jquery.integration</code> to <code>false</code> in your <code>serenity.conf</code>, as this can speed up the page load.</p>
</div>
</div>
</div>
<div class="sect1">
Expand Down