当我尝试此代码但测试用例执行成功时,我收到警告讯息。Selenium - Firefox - Java - Gecko - 警告讯息
代码
package test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class teatcalss {
public static void main(String[] args) {
// declaration and instantiation of objects/variables
System.setProperty("webdriver.gecko.driver", "D:\\java\\geckodriver-v0.14.0-win64\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
String baseUrl = "http://newtours.demoaut.com";
String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = "";
// launch Firefox and direct it to the Base URL
driver.get(baseUrl);
// get the actual value of the title
actualTitle = driver.getTitle();
/*
* compare the actual title of the page witht the expected one and print
* the result as "Passed" or "Failed"
*/
if (actualTitle.contentEquals(expectedTitle)){
System.out.println("Test Passed!");
} else {
System.out.println("Test Failed");
}
//close Firefox
driver.close();
// exit the program explicitly
System.exit(0);
}
}
警告消息
1486664295999 geckodriver信息上侦听127.0.0.1:44072 2017年2月9日上午10时18分十六秒org.openqa.selenium.remote。 ProtocolHandshake createSession INFO:尝试双方言会话,假设Postel法则在远程端为真 log4j:WARN无法找到记录器(org.apache.http.client.protocol.RequestAddCookies)的appender。 log4j:WARN请正确初始化log4j系统。 log4j:WARN有关更多信息,请参阅http://logging.apache.org/log4j/1.2/faq.html#noconfig。 1486664297761 mozprofile :: profile INFO使用配置文件路径C:\ Users \ Radwa \ AppData \ Local \ Temp \ rust_mozprofile.DhhwmmiiHibT 1486664297779 geckodriver :: marionette信息启动浏览器C:\ Program Files(x86)\ Mozilla Firefox \ firefox.exe 1486664297822 geckodriver ::木偶信息连接到木偶在localhost:10262 [GFX1-]:CreateShaderResourceView失败format87 1486664301804木偶信息侦听端口10262 [GFX1-]:CreateShaderResourceView失败format87 2017年2月9日10:18 :29 AM org.openqa.selenium.remote.ProtocolHandshake createSession 信息:检测到的方言:W3C 测试通过!
你的问题是什么? –