Marionette-WARN-TLS 证书错误将忽略此会话警告,使用 GeckoDriver 和 Firefox 通过 Selenium 和 Java
Marionette-WARN-TLS certificate errors will be ignored for this session warning using GeckoDriver and Firefox through Selenium and Java
我是 Selenium WebDriver 的初学者。我写了一个代码来导航到 URL 并登录。还要在控制台中显示字符串 URL 的消息与当前的 URL 一样正确。代码正在成功执行并按预期工作。它正在登录。但同时在控制台中收到一些警告消息。有人可以让我知道警告消息的原因吗?是因为缺少任何 jar 文件吗?我使用的是最新版本的 JDK 和 Selenium WebDriver。
请查看下面的代码片段和控制台错误。
代码如下:
package testSelenium1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class admin {
public static void main(String args[]) {
System.setProperty("webdriver.gecko.driver","C:\Users\30211170\Downloads\geckodriver-v0.26.0-win64\geckodriver.exe");
WebDriver driver = new FirefoxDriver();// Launches firefox browser with blank URL
driver.get("http://www.gcrit.com/build3/admin/login.php?");
driver.findElement(By.name("username")).sendKeys("admin");
driver.findElement(By.name("password")).sendKeys("admin@123");
driver.findElement(By.id("tdb1")).click();
String url = driver.getCurrentUrl();
if (url.equals("http://www.gcrit.com/build3/admin/index.php")) {
System.out.println("Login is success");
} else {
System.out.println("Log in failed");
}
}
}
警告信息如下:
1576773751789 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\Users\30211170\AppData\Local\Temp\rust_mozprofile69gY6Q"
1576773753129 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1576773753129 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1576773753130 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1576773753130 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1576773756768 Marionette INFO Listening on port 64629
1576773757219 Marionette WARN TLS certificate errors will be ignored for this session
Dec 19, 2019 10:12:37 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Login is success
这条警告消息...
1576850500604 Marionette WARN TLS certificate errors will be ignored for this session
...暗示 Marionette 将忽略此会话的 TLS 证书错误。
这个WARNING是在 initiates a new Browsing Context i.e. Firefox Browser session using geckodriver through marionette.
时生成的
结论
此 WARNING
消息对您的 @Tests 无害,您可以安全地忽略它。
我是 Selenium WebDriver 的初学者。我写了一个代码来导航到 URL 并登录。还要在控制台中显示字符串 URL 的消息与当前的 URL 一样正确。代码正在成功执行并按预期工作。它正在登录。但同时在控制台中收到一些警告消息。有人可以让我知道警告消息的原因吗?是因为缺少任何 jar 文件吗?我使用的是最新版本的 JDK 和 Selenium WebDriver。 请查看下面的代码片段和控制台错误。
代码如下:
package testSelenium1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class admin {
public static void main(String args[]) {
System.setProperty("webdriver.gecko.driver","C:\Users\30211170\Downloads\geckodriver-v0.26.0-win64\geckodriver.exe");
WebDriver driver = new FirefoxDriver();// Launches firefox browser with blank URL
driver.get("http://www.gcrit.com/build3/admin/login.php?");
driver.findElement(By.name("username")).sendKeys("admin");
driver.findElement(By.name("password")).sendKeys("admin@123");
driver.findElement(By.id("tdb1")).click();
String url = driver.getCurrentUrl();
if (url.equals("http://www.gcrit.com/build3/admin/index.php")) {
System.out.println("Login is success");
} else {
System.out.println("Log in failed");
}
}
}
警告信息如下:
1576773751789 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\Users\30211170\AppData\Local\Temp\rust_mozprofile69gY6Q"
1576773753129 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1576773753129 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1576773753130 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1576773753130 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1576773756768 Marionette INFO Listening on port 64629
1576773757219 Marionette WARN TLS certificate errors will be ignored for this session
Dec 19, 2019 10:12:37 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Login is success
这条警告消息...
1576850500604 Marionette WARN TLS certificate errors will be ignored for this session
...暗示 Marionette 将忽略此会话的 TLS 证书错误。
这个WARNING是在
结论
此 WARNING
消息对您的 @Tests 无害,您可以安全地忽略它。