-1
的RC启动Firefox浏览器,但它试图打开以下链接 “铬://src/content/RemoteRunner.html的sessionId = 94c0e90deec8470ab358718255d27575 &多窗口=真&的baseUrl = HTTPS%3A%2F%2Fwww.facebook.com%2F & debugMode =假& driverUrl “而不是硒RC是不开放在我的代码指定网址
”= http://localhost:4444/selenium-server/driver/https://www.facebook.com/“
import static org.junit.Assert.*;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
@SuppressWarnings("deprecation")
public class DemoClass {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", "https://www.facebook.com/");
selenium.start();
}
@Test
public void Assignment1() throws Exception {
selenium.open("/");
assertTrue(selenium.isElementPresent("id=email"));
assertTrue(selenium.isElementPresent("id=pass"));
selenium.type("id=email", "[email protected]");
selenium.type("id=pass", "[email protected]");
assertEquals("[email protected]", selenium.getValue("id=email"));
selenium.click("id=u_0_n");
selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}