Getting a specific error in all browsers

126 views
Skip to first unread message

MuthuManikandan N

unread,
Dec 28, 2019, 11:39:35 AM12/28/19
to Selenium Users
Hi All,

I am a new leaner , i am trying to execute simple selenium code but it throws below error,

Code:

package sampletest;

import org.openqa.selenium.JavascriptExecutor;  
import org.openqa.selenium.WebDriver;  
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions; 
//import org.openqa.selenium.ie.InternetExplorerDriver;

public class smaple {

public static void main(String[] args)  {
 
     //System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe"); 
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") +"\\chromedriver.exe");
 
ChromeOptions options = new ChromeOptions();
        // Instantiate a ChromeDriver class.     
   WebDriver driver=new ChromeDriver();  
     
      // Launch Website  
   driver.navigate().to("http://www.javatpoint.com/");  
     
    //Maximize the browser  
     driver.manage().window().maximize();  
     
     //Scroll down the webpage by 5000 pixels  
   JavascriptExecutor js = (JavascriptExecutor)driver;  
   js.executeScript("scrollBy(0, 5000)");   
     
    // Click on the Search button  
   driver.findElement(By.linkText("Core Java")).click();     

}

}


Error:

Starting ChromeDriver 80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}) on port 10917
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.WebDriverException: unknown error: cannot find Chrome binary
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'MUTHU-PC', ip: '192.168.42.150', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_201'
Driver info: driver.version: ChromeDriver
remote stacktrace: Backtrace:

Aniket Mane

unread,
Dec 28, 2019, 11:48:07 AM12/28/19
to seleniu...@googlegroups.com
Its clearly a issue of chrome browser. You need to set binary path for chrome, check syntax on the internet.

second thing why you have written chromoptions line if you are not using it.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/56f80c57-fb33-4c25-8c1e-1a9af51fdbbe%40googlegroups.com.

Oleg Svitskyi

unread,
Dec 31, 2019, 8:14:11 AM12/31/19
to Selenium Users
Hello

The your issue is in versions compatibility

Check this out
If you are using Chrome version 80, please download ChromeDriver 80.0.3987.16 
If you are using Chrome version 79, please download ChromeDriver 79.0.3945.36 
If you are using Chrome version 78, please download ChromeDriver 78.0.3904.105



You're using chromedriver version 80+ for chrome 79.x-
Reply all
Reply to author
Forward
0 new messages