selenium回放问题
selenium ide 2.8录制完后转为Java代码在eclipse上运行package selenium_test;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
public class setup {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://192.168.1.250:8888/");
selenium.start();
}
为什么运行的浏览器是Firefox
运行完后Firefox崩溃了
F:\mozilla.jpg 把chrome的绝对路径给它就可以了,类似 selenium = new DefaultSelenium("localhost", 4444, "*firefox D:\\Program Files\\Mozilla Firefox\\firefox.exe", "http://192.168.1.243:82/"); mutou70345 发表于 2014-12-31 10:21
把chrome的绝对路径给它就可以了,类似 selenium = new DefaultSelenium("localhost", 4444, "*firefox D:\ ...
补充一点,需要下载并设置chrome的驱动,chromeDriver
页:
[1]