Monday, 17 December 2012

AjaxControl


import com.thoughtworks.selenium.DefaultSelenium;
public class AjaxControl {
            public static DefaultSelenium selenium=new DefaultSelenium("localhost",4444,"*firefox","http://");
            public static String Ajax() throws Exception
            {
                        selenium.start();
                        selenium.open("http://google.co.in");
                        selenium.windowMaximize();
                        selenium.type("gbqfq", "Selenium");
                        Thread.sleep(1000);
                        String str=selenium.getText("//html/body/table/tbody/tr/td[2]");
                        System.out.println(str);
                        return "Pass";
            }
            public static void main(String[] args) throws Exception {
                        // TODO Auto-generated method stub
                        Ajax();
            }
}

No comments:

Post a Comment