Unable to load chrome in Selenium

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to load chrome in Selenium

bertonangkil

Hi,

I need help. I can't launch chrome using Selenium. I tried doing the recommended fix of updating chrome and also tried to use guava 20, 21 and 22 but still i get the same error as below when i run the code. See code and error for reference. Appreciate all the help i can get. Thanks!

Code:

package TestPack;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class SE {

public static void main(String args[])
{
			System.setProperty("webdriver.chrome.driver","C:\\Users\\albert.g.nangkil\\workspace\\chromedriver.exe");
			WebDriver driver = new ChromeDriver();		
			driver.get ("www.google.com");
			driver.manage().window().maximize();
			driver.getTitle();
			System.out.println(driver.getTitle());
}

Error: Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:124)

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a2914493-5e53-477a-a878-cbae0cc89803%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to load chrome in Selenium

⇜Krishnan Mahadevan⇝

Can you show us how you are managing your CLASSPATH ? You can perhaps share your pom.xml/build.gradle to add more context.

 

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/

 

From: <[hidden email]> on behalf of <[hidden email]>
Reply-To: <[hidden email]>
Date: Friday, June 9, 2017 at 1:07 PM
To: Selenium Users <[hidden email]>
Subject: [selenium-users] Unable to load chrome in Selenium

 

Hi,

I need help. I can't launch chrome using Selenium. I tried doing the recommended fix of updating chrome and also tried to use guava 20, 21 and 22 but still i get the same error as below when i run the code. See code and error for reference. Appreciate all the help i can get. Thanks!

Code:

package TestPack;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class SE {

public static void main(String args[])
{
                           System.setProperty("webdriver.chrome.driver","C:\\Users\\albert.g.nangkil\\workspace\\chromedriver.exe");
                          WebDriver driver = new ChromeDriver();              
                          driver.get ("www.google.com");
                          driver.manage().window().maximize();
                          driver.getTitle();
                          System.out.println(driver.getTitle());
}
 
Error: Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:124)

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a2914493-5e53-477a-a878-cbae0cc89803%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2F0C2E16-1829-442F-B40F-8B2B372A12F6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to load chrome in Selenium

Abhineet Singh
In reply to this post by bertonangkil
Hi berton

I am facing excatly same isue with Selenium Java 3.4.0 in Firefox.
Could you please update how did you resolved the issue?

Thanks in Advance
Abhineet

On Friday, 9 June 2017 13:08:31 UTC+5:30, [hidden email] wrote:

Hi,

I need help. I can't launch chrome using Selenium. I tried doing the recommended fix of updating chrome and also tried to use guava 20, 21 and 22 but still i get the same error as below when i run the code. See code and error for reference. Appreciate all the help i can get. Thanks!

Code:

package TestPack;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class SE {

public static void main(String args[])
{
			System.setProperty("webdriver.chrome.driver","C:\\Users\\albert.g.nangkil\\workspace\\chromedriver.exe");
			WebDriver driver = new ChromeDriver();		
			driver.get ("<a href="http://www.google.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com&#39;;return true;" onclick="this.href=&#39;http://www.google.com&#39;;return true;">www.google.com");
			driver.manage().window().maximize();
			driver.getTitle();
			System.out.println(driver.getTitle());
}

Error: Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:124)

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3a0bbe33-2a83-4379-a7c8-5e4004ebf1fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to load chrome in Selenium

⇜Krishnan Mahadevan⇝

Can you please tell us how are you building your CLASSPATH ? Perhaps you could share your pom.xml (or) your build.gradle file ?

 

If you are NOT using any of the build tools to manage your CLASSPATH, I would strongly recommend that you please do. That way its easy to deal with classpath conflicts and avoid errors such as NoSuchMethodError etc.,

 

 

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/

 

From: <[hidden email]> on behalf of Abhineet Singh <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, June 13, 2017 at 2:07 PM
To: Selenium Users <[hidden email]>
Subject: [selenium-users] Re: Unable to load chrome in Selenium

 

Hi berton

 

I am facing excatly same isue with Selenium Java 3.4.0 in Firefox.

Could you please update how did you resolved the issue?

 

Thanks in Advance

Abhineet

On Friday, 9 June 2017 13:08:31 UTC+5:30, [hidden email] wrote:

Hi,

I need help. I can't launch chrome using Selenium. I tried doing the recommended fix of updating chrome and also tried to use guava 20, 21 and 22 but still i get the same error as below when i run the code. See code and error for reference. Appreciate all the help i can get. Thanks!

Code:

package TestPack;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class SE {

public static void main(String args[])
{
                      System.setProperty("webdriver.chrome.driver","C:\\Users\\albert.g.nangkil\\workspace\\chromedriver.exe");
                        WebDriver driver = new ChromeDriver();              
                        driver.get ("www.google.com");
                        driver.manage().window().maximize();
                        driver.getTitle();
                        System.out.println(driver.getTitle());
}
 
Error: Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:124)

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3a0bbe33-2a83-4379-a7c8-5e4004ebf1fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/78CB6909-7CB4-421E-BE3A-1269B6B179F8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.