Pages

Friday, March 16, 2012

Getting ToolTip Text of Yahoo Image through selenium RC


public class tooltip
 {
public static void main(String[] args)throws Exception
{
DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*firefox","http://");
selenium.start();
selenium.windowMaximize();
selenium.open("http://www.yahoomail.com");
selenium.waitForPageToLoad("50000");
Thread.sleep(2000);
selenium.click("link=Yahoo!");
Thread.sleep(5000);
String tooltip = selenium.getAttribute("xpath=id('y-     col1')/x:div[3]/x:div/x:div/x:div/x:div/x:h2/x:a/x:img/@title");
System.out.println("Tool tip Image title in yahoo is: "+tooltip);
selenium.close();
}

}

No comments:

Post a Comment