Pages

Monday, February 13, 2012

Getting ToolTip Text of Google Image through selenium RC


public class test1
{
    public static void main(String[] args)throws Exception
    {
        DefaultSelenium selenium = new DefaultSelenium("localhost",4444,"*firefox","http://");
        selenium.start();
        selenium.windowMaximize();
         // Google Image
        selenium.open("www.google.com");
        Thread.sleep(3000);
        String tooltip = selenium.getAttribute("xpath=id('hplogo')/@title"); //At Google Logo
        System.out.println("Tool Tip Name: "+tooltip);
    }
}