Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Recommendation</h2> <p>Consider using <a href="http://www.gebish.org/" rel="nofollow">Geb</a>:</p> <blockquote> <p>It brings together the power of <code>WebDriver</code>, the elegance of <code>jQuery</code> content selection, the robustness of <code>Page Object</code> modelling and the expressiveness of the <code>Groovy</code> language.</p> <p>It can be used for scripting, scraping and general automation — or equally as a functional/web/acceptance testing solution via integration with testing frameworks such as <code>Spock</code>, <code>JUnit</code> &amp; <code>TestNG</code>.</p> </blockquote> <h2>Requirements</h2> <p>As mentioned, this is only suitable if you are open to the use of <a href="http://groovy.codehaus.org/" rel="nofollow">Groovy</a>. However, since Groovy integrates so easily with Java, this typically isn't a problem.</p> <p>Furthermore, this will require a browser. I'm not sure if this is a deal breaker for you.</p> <h2>Usage</h2> <p>From the <a href="http://www.gebish.org/manual/current/navigator.html#size_and_location" rel="nofollow">docs</a>:</p> <blockquote> <p>You can obtain the size and location of content on the page. All units are in pixels. The size is available via the height and width properties, while the location is available as the x and y properties which represent the distance from the top left of the page (or parent frame) to the top left point of the content.</p> </blockquote> <p>For example:</p> <pre><code>Browser.drive { // Load the page go "http://myapp.com" // $("a") returns all hyperlinks on the page, similar to jQuery $("a").each { a -&gt; // Display the required link properties and attributes println """ The link to '${a.@href}' with text '${a.text()}' is at location (${a.x}, ${a.y}), with a height of ${a.height}px and a width of ${a.width}px. """ } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload