0

I'm trying to run Selenium Webdriver in chrome Browser using this Java code using : selenium-java-3.141.59 chrome : 87.0.4280.66 java : 14.0.2

package auto;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class ftst {
 
@Test
public void test12() throws Exception{
 
// Initialize browser
WebDriver driver=new ChromeDriver();
 
// Open Google
driver.get("http://www.google.com");
 
// Close browser
driver.close();
}
 
}

But i have this exception

[RemoteTestNG] detected TestNG version 7.3.0
Invalid port. Exiting...
ديسمبر ??, ???? ?:??:?? م org.openqa.selenium.os.OsProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
FAILED: test12
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'DESKTOP-995VK94', ip: '192.168.209.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '14.0.2'
Driver info: driver.version: ChromeDriver
    

so please help me to solve this problem Thanks

  • You set location of chromedriver? `System.setProperty("webdriver.chrome.driver", "Absolute\Path\to\chromedriver.exe");` – KunLun Dec 01 '20 at 18:05
  • 1
    Does this answer your question? [Invalid port. Exiting... org.openqa.selenium.os.OsProcess checkForError while launching chrome using selenium](https://stackoverflow.com/questions/50245718/invalid-port-exiting-org-openqa-selenium-os-osprocess-checkforerror-while-la) – DMart Dec 01 '20 at 18:06

1 Answers1

0

I never used java, it looks like you didnt set the executable path of the Chromedriver. it needs to be specified in the Chromedriver() bracket, except if the driver is in the same folder as the Java file is Edit: another solution seems to be the one which was mentioned in the comments, which you can find here

Timeler
  • 377
  • 1
  • 11