There was an error in this gadget

Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 10 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD

Followers

Thursday, October 14, 2010

How to get the Width and Height of Images or Elements

 public class ImageTests {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub:
        Selenium selenium = new DefaultSelenium("localhost",4444,"*firefox","http://www.google.com");
        selenium.start();
        selenium.open("");
        //Print the Width of the Image
        System.out.println("Width Of Image is : " + selenium.getElementWidth("logo"));
       
        //Print the Height of the Image
        System.out.println("Height Of Image is : " + selenium.getElementHeight("logo"));   
       
        selenium.close();
        selenium.stop();
       
    }

}

No comments:

Post a Comment