Monday, May 30, 2011

How To start Selenium



Follow the below steps:

1. Recode your steps in Selenium IDE

2. Have to convert to java code and paste in the eclipse

3. change the class name like sasidhar and save as sasidhar.java.

4. Start the selenium server

5. Execute your script in sclipse.
================================================
package com.example.tests;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class sasidhar extends SeleneseTestCase {
    public void setUp() throws Exception {
        setUp("http://www.google.com/", "*firefox");
    }
      public void testNew() throws Exception {
          selenium.open("/");
          selenium.type("q", "selenium rc");
          selenium.click("btnG");
          selenium.waitForPageToLoad("30000");
          assertTrue(selenium.isTextPresent("Results * for selenium rc"));
    }
}
============================================

No comments:

Post a Comment