您好我是Selenium的新手,并在eclipse中通过它在Web表单上尝试自动化。但是当我执行我的代码时它会被终止 这是我的代码
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.support.ui.Select;
public class Demo {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.ie.driver", "C:\\selenium\\IEDriverServer_Win32_2.53.1\\IEDriverServer.exe");
WebDriver driver=new `InternetExplorerDriver();
driver.get("http://example.com");
}
}
这是我在控制台上获得的内容
testing US7ASCII against <abc>
PASSED LOSSY
testing US7ASCII against <ab?c>
PASSED LOSSY
testing US7ASCII against <XYZ>
PASSED LOSSY
testing US7ASCII against <longlonglonglong...>
PASSED LOSSY
testing WE8ISO8859P1 against <abc>
PASSED LOSSY
testing WE8ISO8859P1 against <ab?c>
PASSED LOSSY
testing WE8ISO8859P1 against <XYZ>
PASSED LOSSY
testing WE8ISO8859P1 against <longlonglonglong...>
PASSED LOSSY
testing AL24UTFFSS against <abc>
PASSED
testing AL24UTFFSS against <ab?c>
PASSED
testing AL24UTFFSS against <XYZ>
PASSED
testing AL24UTFFSS against <longlonglonglong...>
PASSED
testing UTF8 against <abc>
PASSED
testing UTF8 against <ab?c>
PASSED
testing UTF8 against <XYZ>
PASSED
testing UTF8 against <longlonglonglong...>
PASSED
应用程序在运行后立即终止。请帮忙不知道问题在哪里
答案 0 :(得分:0)
Log显示与selenium代码无关,似乎它正在运行一些JDBC程序。
在eclipse中运行selenium代码的最佳方法,只需右键单击代码,选择RunAs,单击java应用程序。
发布输出...