selenium+junit?junit跑起来了。selenium服务器也开了!也没报错!但是不会执行selenium ide录制
.bat:java-jarD:\顽固病毒\jar\selenium\selenium全\selenium-server-standalone-2.7.0-patched....
.bat:
java -jar D:\顽固病毒\jar\selenium\selenium全\selenium-server-standalone-2.7.0-patched.jar -interactive
junit:
package com.test;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class test {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox D:\\mozilla firefox\\firefox.exe", "http://www.baidu.com/");
selenium.start();
}
@Test
public void testTest() throws Exception {
selenium.open("/");
selenium.type("id=kw", "selenium");
selenium.click("id=su");
selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
jar包
runs1/1 error 0 failure 0 展开
java -jar D:\顽固病毒\jar\selenium\selenium全\selenium-server-standalone-2.7.0-patched.jar -interactive
junit:
package com.test;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class test {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox D:\\mozilla firefox\\firefox.exe", "http://www.baidu.com/");
selenium.start();
}
@Test
public void testTest() throws Exception {
selenium.open("/");
selenium.type("id=kw", "selenium");
selenium.click("id=su");
selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
jar包
runs1/1 error 0 failure 0 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询