Monday 17 December 2012

Selenium RegularExpression

import com.thoughtworks.selenium.DefaultSelenium;
public class RegularExpression {
    public static DefaultSelenium selenium=new DefaultSelenium("localhost",4444,"*firefox","http://");
    public static String OpenURL() throws Exception
    {
        selenium.start();
        selenium.open("http://google.co.in");
        selenium.windowMaximize();
         selenium.type("id=gbqfq", "seleniumhq.org");
         selenium.click("id=gbqfb");
         Thread.sleep(5000);
         selenium.click("link=regexp:Down.*");
        return "Pass";
    }
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        selenium.open("http://google.co.in");
                    selenium.windowMaximize();
                  

    }

}

No comments:

Post a Comment