@Override public void type(String locator, String value) { selenium.type(locator, value); }
public void type(String locator, String value) { selenium.type(locator, value); }
public void type(String locator, String value) { base.type(locator, value); }
public void type(String locator, String value) { selenium.type(locator, value); }
public void type(String locator, String value) { sel.type(locator, value); }
public void type(ElementLocator<?> elementLocator, String value) { selenium.type(elementLocator.inSeleniumRepresentation(), value); }
public void typeKeys(ElementLocator<?> elementLocator, String value) { selenium.type(elementLocator.inSeleniumRepresentation(), value); }
WebDriver driver = new FirefoxDriver(); Selenium selenium = new WebDriverBackedSelenium(driver, URL); selenium.open() selenium.type() or any other function;
public class TestBase { protected WebDriver driver; protected Selenium selenium @Before public void setUp() throws Exception { driver = new FirefoxDriver(); String baseUrl = "http://trn-test-web.fon.com/"; selenium = new WebDriverBackedSelenium(driver, baseUrl); } @Test public void firstTest() throws Exception{ selenium.open("/opencase/login.seam"); selenium.type("//input[contains(@id, ':username')]", "admin"); selenium.type("//input[contains(@id,':mypassword')]", "admin"); selenium.click("//a[contains(@id,'loginForm:')]/span"); selenium.waitForPageToLoad("60000"); _wait("Home", "id=oc-title-id"); }
Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox", BASE_URL); selenium.start(); selenium.open(BASE_URL); selenium.type("j_idt8:inputName", "Robot"); selenium.click("j_idt8:_t12"); selenium.waitForCondiditon("selenium.isElementPresent('j_idt17:input')", MAX_WAIT_TIME_IN_MS); selenium.type("j_idt17:input", "Selenium testing in proggress...."); selenium.click("j_idt17:_t20"); selenium.waitForCondiditon("selenium.isElementPresent('j_idt17:input')", MAX_WAIT_TIME_IN_MS); selenium.type("j_idt17:input", "Test over!"); selenium.click("j_idt17:_t20"); selenium.stop();
Selenium selenium=new DefaultSelenium("localhost", 4444 , "*firefox","myurl"); selenium.start(); selenium.open("myurl"); System.out.println("Open browser "+selenium); selenium.windowMaximize(); selenium.type("id=j_username","Lal"); selenium.type("name=j_password","lal"); selenium.click("name=submit"); **selenium.waitForPageToLoad("60000");** if(selenium.isTextPresent("Lal")) { selenium.click("id=common_header_logout"); } else { System.out.println("User not found"); }
import com.thoughtworks.selenium.DefaultSelenium; import com.thoughtworks.selenium.Selenium; public class TestRun { public static void main(String[] args) { Selenium selenium=new DefaultSelenium("localhost", 4444 , "*firefox","myurl"); selenium.start(); selenium.open("myurl"); System.out.println("Open browser "+selenium); selenium.windowMaximize(); selenium.type("id=j_username","Lal"); selenium.type("name=j_password","lal"); selenium.click("name=submit"); **selenium.waitForPageToLoad("60000");** if(selenium.isTextPresent("Lal")) { selenium.click("id=common_header_logout"); } else { System.out.println("User not found"); } } }
browser.type("q", "hello world");