Created
January 11, 2012 18:29
-
-
Save krzysdb/1596037 to your computer and use it in GitHub Desktop.
WebDriverBackedSelenium simple test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.MalformedURLException; | |
import java.net.URL; | |
import com.thoughtworks.selenium.*; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebDriverBackedSelenium; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
@SuppressWarnings("deprecation") | |
public class WebDriverBackedSelenium_simple extends SeleneseTestCase { | |
public String SITE_URL = "http://127.0.0.1:4444/wd/hub"; | |
public static Selenium selenium; | |
@Before | |
public void setUp() throws Exception { | |
DesiredCapabilities capabilites = DesiredCapabilities.firefox(); | |
WebDriver driver = null; | |
try { | |
driver = new RemoteWebDriver( new URL(SITE_URL), capabilites); | |
} catch (MalformedURLException e) { | |
e.printStackTrace(); | |
} | |
selenium = new WebDriverBackedSelenium(driver,"http://www.google.com/"); | |
selenium.open("/"); | |
selenium.windowFocus(); | |
selenium.windowMaximize(); | |
} | |
@Test | |
public void testing(){ | |
selenium.open("http://www.yahoo.com"); | |
} | |
@After | |
public void tearDown() throws Exception { | |
selenium.stop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment