Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've found a solution to my own problem. When you run tests with Selenium, it starts two windows: 1) The Selenium window executing all the commands 2) The Browser window in which the website is tested.</p> <p>When you try to get info about window 2 via JavaScript functions, you need to do the following: selenium.browserbot.getCurrentWindow()</p> <p>To get the full height of a browser window cross browser via selenium, you'll need following script:</p> <pre><code>function getPageHeight(){ $scrOfY = 0; $test = $this-&gt;getEval("typeof(selenium.browserbot.getCurrentWindow().pageYOffset)"); if(strcmp($test,"number") == 0) { //Netscape compliant $scrOfY = (int)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().pageYOffset;"); //scrOfX = window.pageXOffset; } else if( (bool)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.body != null") &amp;&amp; (bool)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.body.scrollTop != null")) { //DOM compliant $scrOfY = (int)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.body.scrollTop;"); //scrOfX = document.body.scrollLeft; } else if( (bool)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.documentElement != null") &amp;&amp; (bool)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.documentElement.scrollTop != null")) { //IE6 standards compliant mode $scrOfY = (int)$this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.documentElement.scrollTop;"); //scrOfX = document.documentElement.scrollLeft; } if(!$scrOfY || $scrOfY &lt;= 0) $scrOfY = $this-&gt;getEval("selenium.browserbot.getCurrentWindow().document.body.offsetHeight"); return $scrOfY; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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