Unable to find a matching set of capabilities with selenium 3.8.1 and gecko driver 0.19.0 Unable to find a matching set of capabilities with selenium 3.8.1 and gecko driver 0.19.0 selenium selenium

Unable to find a matching set of capabilities with selenium 3.8.1 and gecko driver 0.19.0


new FirefoxDriver(DesiredCapabilities caps); 

is deprecated, use

FirefoxOptions options = new FirefoxOptions();options.setCapability("marionette", false);WebDriver webDriver = new FirefoxDriver(options);

and you are good to go


Another possible cause is the outdated Firefox version.

I upgraded the version and it works fine!

I could open the browser only setting options.setCapability("marionette", true);, then in the open window I upgraded through the "About Firefox" dialog. Then you have to remove the line about marionette.

Probably the one I had was only going to work with marionette while we are trying to use it with geckodriver, which has a different protocol. Anyone who knows more than me can confirm or deny!


SessionNotCreatedException

SessionNotCreatedException extends WebDriverException and is a RuntimeException which indicates that a session could not be created.

Possible Causes :

The possible causes of a new session not getting created are as follows :

  • Compatibility issues between JDK, Selenium, WebDriver and Web Browser versions.
  • Accessing the same port number by GeckoDriver or Marionette by the new session which previous session have't released yet.
  • Lack of access to CPU
  • Lack of Physical Memory
  • Lack of Swap Memory
  • Lack of Disc Cache
  • Lack of Network Bandwidth
  • Presence of OS chores within the system.

Code Block :

I don't see any coding issue in your code block as such.

Solution :

The simple solution would be as follows :

  • Always use the latest released version of JDK (Java SE 9.0.1), Selenium-Java client (v3.8.1), WebDriver variant (GeckoDriver v0.19.1) and Web Browser (Firefox Quantum Browser).
  • If the base version of the Web Browser is too old consider uninstalling the Browser through Revo Uninstaller and install a recent released GA version of Firefox Browser.
  • Always use quit() in the tearDown() method so that the webdriver and the webclient both are properly destroyed.
  • Clean the Project Workspace from your IDE before and after executing your Test Suite.
  • Clear the Browser Cache before and after the execution of your Tests.
  • Use CCleaner tool regularly to wipe away the OS chores.
  • Execute your Test.