Package br.com.caelum.seleniumdsl.test

Source Code of br.com.caelum.seleniumdsl.test.Scrap

package br.com.caelum.seleniumdsl.test;

import org.openqa.selenium.server.SeleniumServer;

import br.com.caelum.seleniumdsl.Browser;
import br.com.caelum.seleniumdsl.DefaultBrowser;
import br.com.caelum.seleniumdsl.Field;
import br.com.caelum.seleniumdsl.Form;
import br.com.caelum.seleniumdsl.Page;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.SeleniumLogLevels;

public class Scrap {
  public static void main(String[] args) {
    Selenium selenium = new DefaultSelenium("http://www.google.com", SeleniumServer.getDefaultPort(), "*firefox",
        "http://www.google.com");
    selenium.start();
    selenium.setContext("A real test, using the real Selenium on the browser side served by Jetty, driven from Java");
    selenium.setBrowserLogLevel(SeleniumLogLevels.WARN);

    Browser browser = new DefaultBrowser(selenium);
    browser.open("/");
    selenium.stop();

    Page currentPage = browser.currentPage();
    Form form = currentPage.form("id");
    Field field = form.field("fieldName");
  }
}
TOP

Related Classes of br.com.caelum.seleniumdsl.test.Scrap

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.