Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary

Hi

i have searched error but I can’t solve the error Please help me

Starting ChromeDriver 103.0.5060.53 (a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/5060@{#853}) on port 36518
Only local connections are allowed.
Please see ChromeDriver - WebDriver for Chrome - Security Considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary
Build info: version: ‘4.0.0’, revision: ‘3a21814679’
System info: host: ‘kamal-Lenovo-G50-80’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘5.4.0-117-generic’, java.version: ‘17.0.2’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
** at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)**
** at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)**
** at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)**
** at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)**
** at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)**
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:168)
at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:104)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:91)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:46)
at com.practise.Testrun.main(Testrun.java:11)

இங்கே குறிப்பிட்டுள்ள வழிமுறையை முயற்சித்து பார்க்கவும்.

சிக்கல் சரியாகி விட்டால் கூறவும்.

Already done in terminal sudo apt install -y chromium

Eclipse - Already added below points
ChromeOptions options = new ChromeOptions(); options.setBinary(“/usr/bin/chromium”);

It’s not working, Same error displaying

குரோம்டிரைவர் உருவாக்கும்போது இந்த ஆப்ஷனை அளித்தீர்களா?

ChromeOptions options=new ChromeOptions();
options.setBinary("/usr/bin/chromium");
ChromeDriver driver = new ChromeDriver(options);

yes added. same response

Could not start a new session. Response code 500. Message: unknown error: no chrome binary at /usr/bin/chromium

dpkg --listfiles chromium | grep bin/

ctrl-alt-t கொடுத்து வரும் டெர்மினலில் இந்த கமாண்டை இயக்கவும். வரும் விடையை பகிரவும்.

kamal@kamal-Lenovo-G50-80:~$ dpkg --listfiles chromium | grep bin/
/usr/bin/chromedriver
/usr/bin/chromium

தற்போது வரும் எரர் மெசேஜை இங்கே பதியவும்.

Could not start a new session. Response code 500. Message: unknown error: no chrome binary at /usr/bin/chromium

முழுவதுமாக பதியவும். ஸ்டேக் டிரேஸ் உட்பட.


Starting ChromeDriver 103.0.5060.53 (a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/5060@{#853}) on port 56066
Only local connections are allowed.
Please see ChromeDriver - WebDriver for Chrome - Security Considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: no chrome binary at /usr/bin/chromium
Build info: version: ‘4.2.2’, revision: ‘683ccb65d6’
System info: host: ‘kamal-Lenovo-G50-80’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘5.4.0-120-generic’, java.version: ‘17.0.2’
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: /usr/bin/chromium, extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], binary: /usr/bin/chromium, extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:102)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:588)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:283)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:184)
at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:106)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:106)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:93)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:82)
at seproject.Runse.main(Runse.java:15)

System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
ChromeOptions options=new ChromeOptions();
options.setBinary("/usr/bin/chromium");
ChromeDriver driver = new ChromeDriver(options);

இதை முயற்சித்து பார்க்கவும்

Exception in thread "main" java.lang.IllegalStateException: The driver executable must exist: /usr/bin/chromedriver
	at org.openqa.selenium.internal.Require$FileStateChecker.isFile(Require.java:342)
	at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:147)
	at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:142)
	at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:38)
	at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:231)
	at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:437)
	at org.openqa.selenium.chrome.ChromeDriverService.createServiceWithConfig(ChromeDriverService.java:141)
	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
	at seproject.Runse.main(Runse.java:15)

it’s not working

ls -ltr /usr/bin/chromedriver /usr/bin/chromium

இந்த கமாண்டை இயக்கவும். என்ன வருகின்றது என்று பார்க்கவும்.

-rwxr-xr-x 1 root root      886 May 25 01:03 /usr/bin/chromium
-rwxr-xr-x 1 root root 12064480 May 25 01:03 /usr/bin/chromedriver

இது தான் வருகிறது

தேவைபடும் நிரல்கள் உள்ளன ஆனால் ஏன் இவ்வாறு வருகின்றது என்று தெரியவில்லை. செலினியம் பற்றி நன்றாக தெரிந்தவர்கள் யாரேனும் உதவும்

Try running selinum with sudo. I think Selinium does not have permission to access the driver. If this works , then it means Selinium creates it own user and group. Try to add that to sudo.

sudo selinium

sudo: selenium: command not found
sudo: selinium: command not found
it’s not working

options.setBinary(“/usr/bin/chromium”);

பதிலாக இதை தந்து பார்க்க

options.setBinary(“/usr/bin/google-chrome”);

மேலும இதை பார்க்க

Could not start a new session. Response code 500. Message: unknown error: no chrome binary at /usr/bin/chromium

Could not start a new session. Response code 500. Message: unknown error: no chrome binary at /usr/bin/google-chrome
it’s not working