छवि आईडी 'FlashID1x' के खिलाफ GetSize(), GetLocation() फ़ंक्शंस का उपयोग करते समय हमेशा 250,300 दे रहा है लेकिन तत्व की वास्तविक ऊंचाई और चौड़ाई 1 एक्स 1 है जो मूल रूप से गलत है।
<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"/>
यहाँ मेरी कोड है::
यहाँ मेरी लक्ष्य डोम है
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());
स्पष्ट करने के लिए, आप छवि को ही (1x1) के आकार पाने के लिए कोशिश कर रहे हैं या छवि (300x250) युक्त 'img' तत्व का आकार? –
छवि का आकार –
छवि का आकार प्राप्त करने का अंतिम लक्ष्य क्या है? –