Selenium RC没有打开我的代码中给出的URL

时间:2017-02-23 18:51:47

标签: java selenium selenium-webdriver selenium-rc selenium-firefoxdriver

RC启动firefox浏览器,但它尝试打开以下链接 "铬://src/content/RemoteRunner.html的sessionId = 94c0e90deec8470ab358718255d27575&安培;多窗口=真安培;的baseUrl = HTTPS%3A%2F%2Fwww.facebook.com%2F&安培; debugMode =假安培; driverUrl = {{3} }"

代替" http://localhost:4444/selenium-server/driver/"

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", "devranipankaj163@gmail.com");
            selenium.type("id=pass", "demo@123");
        assertEquals("devranipankaj163@gmail.com", selenium.getValue("id=email"));
        selenium.click("id=u_0_n");
        selenium.waitForPageToLoad("30000");
     }

    @After
    public void tearDown() throws Exception {
        selenium.stop();
    }
}

0 个答案:

没有答案