I'm currently trying to write a script for Ghost Browser (Chromium based browser).
ChromeOptions options = new ChromeOptions();
options.setBinary("C:\\Users\\Admin\\AppData\\Local\\GhostBrowser\\Application\\ghost.exe");
ChromeDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com");
I set the binary path of ChromeDriver to the path of Ghost Browser.
When I execute it, it executes but instantly closes, and gives the following error.
I don't know how to handle it, or what arguments to set in order to make it work,
please help.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 51746
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.19043 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.09 seconds
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'ADMIN-PC', ip: '10.6.0.129', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: C:\Users\Admin\AppData\Loca..., extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: C:\Users\Admin\AppData\Loca..., extensions: []}}}]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:217)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:169)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$1(ProtocolHandshake.java:133)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1002)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:135)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:80)
at extras.testclass.main(testclass.java:16)
This error message...
Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 51746
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as:
You are using chromedriver=2.46 which is quite old and ancient.
Solution
Ensure that:
ChromeDriver is updated to current ChromeDriver v98.0 level.
Update
You need to download the latest ChromeDriver e.g. ChromeDriver v98.0.4758.102 and store it in your system. Next you have to mention the absolute path of the chromedriver executable through System.setProperty() line as follows:
System.setProperty("webdriver.chrome.driver", "C:\\path\\to\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setBinary("C:\\Users\\Admin\\AppData\\Local\\GhostBrowser\\Application\\ghost.exe");
ChromeDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com");
Related
After chrome was updated to the newest - 109 version not able to run my test using Selenium. Could it be because of unstable version of chrome driver?
Here is my Set Up class:
public WebDriver driver; `
#BeforeMethod
public void popUp(){
System.setProperty("webdriver.chrome.driver","/Users/quart_alex/Desktop/com_preemAQA/chromedriver/chromedriver");
driver = new ChromeDriver();
driver.manage().window().maximize();
WebDriverManager.chromedriver().setup();
}
}
I can't run my tests now, tried to download different available the newest versions of chrome driver.
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Starting ChromeDriver 109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414#{#1172}) on port 46117
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'MacBook-Pro-Ihor.local', ip: '127.0.0.1'
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '11.0.11'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []
I'm struggling in attaching Chromedriver to an existing Chrome session; the idea is to work always on a specific chrome separate session istance which I use only for this application. I found some similar questions but didn't helped: please note driver and chrome versions correctly match.
Opening Chrome with batch file:
chrome.exe --user-data-dir="C:\Users\aless\AppData\Local\Google\Chrome\UserDataDebug2" -–remote-debugging-port=9222
Initializing ChromeDriver:
//Please note: it works fine without the ChromOptions, but it will open a new istance at every run of the application, forcing me to repeat the login in the website. That's why I want to work always in the same profile/session (UserDataDebug2) and connect always to that.
System.setProperty("webdriver.chrome.driver","chromedriver/chromedriver.exe");
ChromeOptions option = new ChromeOptions();
option.setExperimentalOption("debuggerAddress","localhost:9222");
DriverManager driverManager = new DriverManager(new ChromeDriver(option));
DriverManager class:
// Not really important: I hold here the reference to the driver just in order to have all functions which use the driver in this class
public class DriverManager {
private WebDriver driver;
JavascriptExecutor js;
public DriverManager(WebDriver driver) {
this.driver = driver;
js = (JavascriptExecutor) driver;
}
Console Error output:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 100.0.4896.60 (6a5d10861ce8de5fce22564658033b43cb7de047-refs/branch-heads/4896#{#875}) on port 63484
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot connect to chrome at localhost:9222
from chrome not reachable
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: 'ALESURFACE', ip: '', os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.2'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], debuggerAddress: localhost:9222, extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], debuggerAddress: localhost:9222, extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:558)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:161)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:106)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:93)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
at main.main(main.java:21)
I'm trying to get started using selenium and have downloaded a chrome driver and put into my classpath. I'm just trying to get the title right now to see if I can get it to work. Code currently looks like this:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Flows {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "/Users/mn/Desktop/project/turv/src/main/chromedriver");
WebDriver driver = new ChromeDriver();
String baseUrl = "http://google.dk/";
driver.get(baseUrl);
System.out.println(driver.getTitle());
driver.close();
}
}
I expected my output to be something along the lines of "Google", but I get this error instead:
Connected to the target VM, address: '127.0.0.1:55299', transport: 'socket'
Starting ChromeDriver (v2.8.241036) on port 2571
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
May 07, 2018 12:12:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Disconnected from the target VM, address: '127.0.0.1:55299', transport: 'socket'
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"11895A1B77AC560388AA2919259E1422","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=66.0.3359.139)
(Driver info: chromedriver=2.8.241036,platform=Mac OS X 10.13.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'cetreas-MBP', ip: 'fe80:0:0:0:c9e:2c67:1d27:4e0b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {userDataDir: /var/folders/s7/lv2wt4t15cn...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, javascriptEnabled: true, locationContextEnabled: true, nativeEvents: true, platform: MAC, platformName: MAC, rotatable: false, takesHeapSnapshot: true, takesScreenshot: true, version: 66.0.3359.139, webStorageEnabled: true}
Session ID: ca1f4ba131e73c3d01058bec2b976d22
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:273)
at com.cetrea.flows.Flows.main(Flows.java:15)
I cant really figure out what the error is trying to tell me. Is it because I'm asking for the title before it has fully loaded the site maybe? Do I need to add some kind of waitforit command before the getTitle() ?
This error message...
org.openqa.selenium.WebDriverException: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"11895A1B77AC560388AA2919259E1422","isDefault":true},"id":1,"name":"","origin":"://"}
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.8 which is pretty ancient.
You are using chrome=66.0
Release Notes of ChromeDriver v2.38 clearly mentions the following :
Supports Chrome v65-67
So there is a clear mismatch between ChromeDriver version (v2.8) and the Chrome Browser version (v66.0)
Solution
Upgrade ChromeDriver to current ChromeDriver v2.38 level.
Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
MAC: 10.11.6,
Selenium: 2.53(Also tried with 3.4 and 3.8) &
Java 1.8
Driver settings tried:
String exePath ="/usr/local/Cellar/chromedriver/2.35/bin/chromedriver";
System.setProperty("webdriver.chrome.driver", exePath);
WebDriver driver = new ChromeDriver();
driver = new ChromeDriver(options);
Error stack trace:
Starting ChromeDriver 2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef) on port 14988
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from disconnected: unable to connect to renderer
(Session info: chrome=64.0.3282.140)
(Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.55 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: '01hw382197', ip: '172.25.155.171', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at dataAndConfig.DriverClass.getDriver(DriverClass.java:39)
at scriptsPostPaidWebApp.BillingPayNow.main(BillingPayNow.java:27)
Have a look at the following links:
https://github.com/SeleniumHQ/selenium/issues/4897
WebDriverError: disconnected: unable to connect to renderer
https://github.com/SeleniumHQ/selenium/issues/4979
First off you should make sure that your ChromeDriver supports your Chrome version. Since you are using ChromeDriver 2.3.5 and Google Chrome v64 you should be fine. (you still might want to upgrade your Selenium version)
According to the links posted above, you need to comment out every method that manipulates the window size of your browser in any way. e.g. setMaximize().
If that didnt work, you might want to give options.addArguments("no-sandbox"); a try.
I have a question and a problem.
Question:
By using Selenium 3.4.0 what is the latest version of Firefox that doesn't require GeckoDriver to run tests. Because using Firefox 45 i can run tests without GeckoDriver, although i thought it is required.
Problem:
I'm trying to use Firefox latest version 53.0, Selenium 3.4.0 and GeckoDriver 0.16.0
I set Firefox to the PATH. I set the path properties for Gecko as follows in this class: enter image description here
, Stack trace:
1493481035911 geckodriver INFO Listening on 127.0.0.1:32281 1493481036538 geckodriver::marionette INFO Starting browser \\?\C:\Program Files (x86)\Mozilla Firefox\firefox.exe with args ["-marionette"] 1493481037661 addons.manager ERROR startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIFile.create]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/FileUtils.jsm :: FileUtils_getDir :: line 70" data: no] Stack trace: FileUtils_getDir()#resource://gre/modules/FileUtils.jsm:70 < FileUtils_getFile()#resource://gre/modules/FileUtils.jsm:42 < validateBlocklist()#resource://greJav/amSocdruilpets /eArdrdoorn:M arnageers.ojusrmc:e6:7/1/ g<r es/tmaordtuulpe(s)/#ArdedsoonuMracnea:g/e/rg.rjes/mm,o dluilnees /1A6d5d7o:n MNaSn_aEgReRrO.Rj_sNmO:T_INIT8I3A4L I<Z EsDt:a rAtdudpo(n)M#arneasgoeurr cies: /n/ogtr ei/nmiotdiualleized
s/AddonManager.jsm:3129 < observe()#resource://gre/components/addonManager.js:65
[GFX1]: Potential driver version mismatch ignored due to missing DLLs 0.0.0.0 and 0.0.0.0
1493481041925 Marionette INFO Listening on port 54083
JavaScript error: resource://gre/modules/AddonManager.jsm, line 2570: NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#150c158, version=, platform=ANY, firefox_profile=org.openqa.selenium.firefox.FirefoxProfile#4524411f}], required capabilities = Capabilities [{}]
Build info: version: 'unknown', revision: '8c03df6', time: '2017-03-02 09:30:17 -0800'
System info: host: 'DESKTOP-HUOROU4', ip: '192.168.43.167', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:293)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:272)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:267)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:130)
at Test.main(Test.java:11)
Let me try to address your question one by one:
By using Selenium 3.4.0 what is the latest version of Firefox that doesn't require GeckoDriver to run tests - With Selenium 3.4.0 you can use Mozilla Firefox 47.x without gecko driver. From Mozilla Firefox 47.x on-wards gecko driver is mandatory.
With Selenium 3.4.0, geckodriver v0.16.1 & Mozilla Firefox 53.0 this piece of code works fine:
System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(dc);
driver.get("http://google.com/");
Moreover, if you are using any extensions in your default Firefox profile either you need to disable/delete them or create a new Firefox profile for your automation work.
Let me know if this helps you.