title: Selenium get natural height and width of an element. should not rely on style attribute. GetSize(), GetLocation() and getRect() fails to do so
body: <p>Here is the scenario.</p>
  
  <p>When am using GetSize(), GetLocation() Functions against the image ID 'FlashID1x' its always giving 250,300 but the actual height and width of an element is 1 X 1 which is basically wrong.</p>
  
  <p>Here is my target dom:</p>
  
  <pre><code>&lt;img id="FlashID1x" border="0" width="300" height="250" style="width:300px;height:250px;" alt="" src="http://s2.adform.net/Banners/invisible.gif?bv=2"/&gt;
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>System.out.println("total : "+iframe.size());  
  //driver.switchTo().frame(frame);
  
  org.openqa.selenium.Point point=driver.findElement(By.xpath(".//*[@id='FlashID1x']")).getLocation();  
  System.out.println("X Position : "+point.x);  
  System.out.println("Y Position : "+point.y);  
  
  System.out.println("X getX : "+point.getX());  
  System.out.println("Y gety : "+point.getY());  
  
  Rectangle pointer=driver.findElement(By.xpath(".//*[@id='FlashID1x']")).getRect();
  System.out.println("height : "+pointer.hashCode();
  System.out.println(" width : "+pointer.getWidth());  
  
  System.out.println("getHeight : "+pointer.getHeight());  
  System.out.println(" getWidth : "+pointer.getWidth());  
  </code></pre>