[英]JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory error using GeckoDriver Firefox and Selenium
I am getting below error even though I had set the correct path for gecko driver.即使我为壁虎驱动程序设置了正确的路径,我也遇到了错误。
Main:主要的:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class firstCase {
@Test
static void titleControl(){
System.setProperty("webdriver.gecko.driver", "D:\\Program Exe's\\geckodriver-v0.26.0-win64\\geckodriver.exe"); // Wee need that as Intellij doesn't know where it looks for browser
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
Assert.assertEquals(driver.getTitle(),"Google");
}
}
Error:错误:
1594880236960 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\yasin\\AppData\\Local\\Temp\\rust_mozprofiledXH35Y"
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1594880239039 Marionette INFO Listening on port 49419
1594880239073 Marionette WARN TLS certificate errors will be ignored for this session
Tem 16, 2020 9:17:19 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
This error message...此错误消息...
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
...implies that there was a JavaScript error while GeckoDriver initiated/spawned a new Browsing Context ie Firefox browsing session. ...暗示在GeckoDriver启动/产生新的浏览上下文时出现JavaScript错误,即Firefox浏览 session。
When Selenium driven GeckoDriver initiates a Firefox browsing session there can be a couple of JavaScript related WARNINGS
and ERRORS
as a part of TRACE
level logs during initialization. When Selenium driven GeckoDriver initiates a Firefox browsing session there can be a couple of JavaScript related
WARNINGS
and ERRORS
as a part of TRACE
level logs during initialization. You can safely ignore those initialization errors till GeckoDriver is successfully able to initiate a Firefox Browsing session.您可以放心地忽略这些初始化错误,直到GeckoDriver能够成功启动Firefox 浏览session。
When the createSession
is successful and W3C
dialect is detected you can safely ignore the errors.当
createSession
成功并且检测到W3C
方言时,您可以放心地忽略错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.