Exception using Selenium with Firefox on MacOS

73 views
Skip to first unread message

Ida Blom

unread,
Feb 22, 2018, 10:06:02 PM2/22/18
to Selenium Users
Hi Everyone

I'm having some trouble getting Firefox to work in Selenium on my Mac.  Any ideas or suggestions would be really appreciated.

Selenium version: 3.7.1 or 3.9.1
Geckodriver: 0.19.1
Java: 8

As soon as I launch I get this:

java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;

My dependencies.gradle file has
ibraries.googleGson = 'com.google.code.gson:gson:2.2.2@jar'

I set my driver like this:

System.getProperties().setProperty("webdriver.gecko.driver",
"/Applications/geckodriver");

I've also tried this:
System.getProperties().setProperty("webdriver.firefox.marionette",
"/Applications/geckodriver");
DesiredCapabilities capabilities= DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);

but I get the same exception - is this just a matter of upgrading the gson jar?
Thanks

Krishnan Mahadevan

unread,
Feb 22, 2018, 10:50:17 PM2/22/18
to seleniu...@googlegroups.com

Yes. You need to upgrade your gson version.

 

Selenium by default would bring in the version that it needs viz., gson 2.8.2

 

See here https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java/3.9.1

 

So you might as well just remove the explicit dependency on gson and try again.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/


Reply-To: <seleniu...@googlegroups.com>
Date: Friday, February 23, 2018 at 8:36 AM
To: Selenium Users <seleniu...@googlegroups.com>
Subject: [selenium-users] Exception using Selenium with Firefox on MacOS

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
selenium-user...@googlegroups.com.
To post to this group, send email to
seleniu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/13c7d4c4-64df-4888-83ac-267846be15be%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages