-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
B-gridEverything grid and server relatedEverything grid and server relatedC-javaJava BindingsJava BindingsD-chromeG-chromedriverRequires fixes in ChromeDriverRequires fixes in ChromeDriverI-defectSomething is not working as intendedSomething is not working as intended
Description
Description
It is impossible to load Chrome extension in a new BiDi way on Selenium Grid, while same code perfectly works locally without Grid.
Pre-conditions:
- Download a Chrome extension as zip file and unpack.
You can use below zip file or download it yourself from https://chromewebstore.google.com/detail/modheader-modify-http-hea/idgpnmonknjnojddfkpgkljpfnnfcklj?utm_source=ext_app_menu with https://chromewebstore.google.com/detail/crx-extractordownloader/ajkhmmldknmfjnmeedkbkkojgobmljda extension.
ModHeader-Modify-HTTP-headers-Chrome-Web-Store.zip - Selenium Grid started
I useddocker run -d --rm -p 4444:4444 -p 7900:7900 --shm-size="2g" --name chrome -e SE_NODE_GRID_URL=http://localhost:4444 selenium/standalone-chromecommand.
Below code is running Chrome locally and works perfectly:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--enable-unsafe-extension-debugging");
chromeOptions.addArguments("--remote-debugging-pipe");
chromeOptions.enableBiDi();
WebDriver driver = new ChromeDriver(chromeOptions);
new WebExtension(driver).install(new InstallExtensionParameters(new ExtensionPath("C:\\Users\\zalma\\Desktop\\ModHeader-Modify-HTTP-headers-Chrome-Web-Store")));
driver.navigate().to("https://google.com");Now run Reproducible Code section for the same in Selenium Grid
It will fail with below logs and exception
Oct 29, 2025 10:18:19 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
Oct 29, 2025 10:18:21 PM org.openqa.selenium.devtools.DevToolsProvider getImplementation
INFO: WebDriver augmented with DevTools interface; connection will not be verified until first use.
Oct 29, 2025 10:18:21 PM org.openqa.selenium.bidi.BiDiProvider getImplementation
INFO: WebDriver augmented with BiDi interface; connection will not be verified until first use.
org.openqa.selenium.bidi.BiDiException: {"error":"unknown error","id":1,"message":"Manifest file is missing or unreadable","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:5590)\n at CommandProcessor.processCommand (\u003Canonymous>:485:13142)","type":"error"}
Build info: version: '4.38.0', revision: '6b412e825c*'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '21.0.2'
Driver info: driver.version: unknown
at org.openqa.selenium.bidi.Connection.sendAndWait(Connection.java:178)
at org.openqa.selenium.bidi.BiDi.send(BiDi.java:51)
at org.openqa.selenium.bidi.webextension.WebExtension.install(WebExtension.java:42)
at selenium.SeleniumExtensionTest.extTest(SeleniumExtensionTest.java:37)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:664)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397)
at org.testng.SuiteRunner.run(SuiteRunner.java:336)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1200)
at org.testng.TestNG.runSuites(TestNG.java:1114)
at org.testng.TestNG.run(TestNG.java:1082)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
Caused by: org.openqa.selenium.WebDriverException: {"error":"unknown error","id":1,"message":"Manifest file is missing or unreadable","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:5590)\n at CommandProcessor.processCommand (\u003Canonymous>:485:13142)","type":"error"}
Build info: version: '4.38.0', revision: '6b412e825c*'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '21.0.2'
Driver info: driver.version: unknown
at org.openqa.selenium.bidi.Connection.handleResponse(Connection.java:327)
at org.openqa.selenium.bidi.Connection.handle(Connection.java:302)
at org.openqa.selenium.bidi.Connection$Listener.lambda$onText$0(Connection.java:277)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)Reproducible Code
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--enable-unsafe-extension-debugging");
chromeOptions.addArguments("--remote-debugging-pipe");
chromeOptions.enableBiDi();
WebDriver driver = new RemoteWebDriver(getSeleniumServerUrl(), chromeOptions);
WebDriver augmented = new Augmenter().augment(driver);
new WebExtension(augmented).install(new InstallExtensionParameters(new ExtensionPath("C:\\Users\\zalma\\Desktop\\ModHeader-Modify-HTTP-headers-Chrome-Web-Store")));
driver.navigate().to("https://google.com");
private static URL getSeleniumServerUrl() {
try {
return URI.create("http://172.17.101.161:4444/wd/hub").toURL();
} catch (MalformedURLException e) {
throw new RuntimeException("Selenium grid hub URL is invalid", e);
}
}Debugging Logs
Oct 29, 2025 10:20:54 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
Oct 29, 2025 10:20:55 PM org.openqa.selenium.remote.RemoteWebDriver log
FINE: Executing: newSession [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--enable-unsafe-extension-d..., --remote-debugging-pipe], extensions: []}, webSocketUrl: true}]}]
Oct 29, 2025 10:20:55 PM org.openqa.selenium.remote.http.jdk.JdkHttpClient execute0
FINE: Executing request: (POST) /session
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.http.jdk.JdkHttpClient execute0
FINE: Ending request (POST) /session in 727ms
Oct 29, 2025 10:20:56 PM io.opentelemetry.sdk.trace.SdkSpan setStatus
FINE: Ignoring setStatus() description since status is not ERROR.
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.tracing.opentelemetry.SeleniumSpanExporter$1 lambda$export$4
FINE: SpanData{spanContext=ImmutableSpanContext{traceId=f75e5cb4e29f2c3fbda932747d215ca6, spanId=c424753805287815, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=f75e5cb4e29f2c3fbda932747d215ca6, spanId=a0a8f080e5c8c711, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, resource=Resource{schemaUrl=null, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.55.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=httpclient.execute, kind=INTERNAL, startEpochNanos=1761801655542322500, endEpochNanos=1761801656280847099, attributes=AttributesMap{data={http.status_code=200, span.kind=client, http.target=/session, http.method=POST}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=OK, description=}, hasEnded=true}
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.ProtocolHandshake createSession
FINE: Detected upstream dialect: W3C
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.tracing.opentelemetry.SeleniumSpanExporter$1 lambda$export$4
FINE: SpanData{spanContext=ImmutableSpanContext{traceId=f75e5cb4e29f2c3fbda932747d215ca6, spanId=a0a8f080e5c8c711, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, resource=Resource{schemaUrl=null, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.55.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=newSession, kind=INTERNAL, startEpochNanos=1761801655448508700, endEpochNanos=1761801656315779700, attributes=AttributesMap{data={command=newSession, parameter.capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--enable-unsafe-extension-d..., --remote-debugging-pipe], extensions: []}, webSocketUrl: true}]}, capacity=128, totalAddedValues=2}, totalAttributeCount=2, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=UNSET, description=}, hasEnded=true}
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.RemoteWebDriver log
FINE: Executed: newSession Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 142.0.7444.59, chrome: {chromedriverVersion: 142.0.7444.59 (4b8153ab58d3..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {args: [--enable-unsafe-extension-d..., --remote-debugging-pipe], extensions: []}, goog:processID: 887, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://localhost:4444/session..., se:containerName: c44fd055244e, se:deleteSessionOnUi: true, se:downloadsEnabled: true, se:gridWebSocketUrl: ws://localhost:9260/session..., se:noVncPort: 7900, se:vnc: ws://localhost:4444/session..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webSocketUrl: ws://localhost:4444/session..., webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Oct 29, 2025 10:20:56 PM org.openqa.selenium.bidi.BiDiProvider getImplementation
INFO: WebDriver augmented with BiDi interface; connection will not be verified until first use.
Oct 29, 2025 10:20:56 PM org.openqa.selenium.devtools.DevToolsProvider getImplementation
INFO: WebDriver augmented with DevTools interface; connection will not be verified until first use.
Oct 29, 2025 10:20:56 PM org.openqa.selenium.bidi.Connection send
FINE: -> {
"method": "webExtension.install",
"id": 1,
"params": {
"extensionData": {
"path": "C:\\Users\\zalma\\Desktop\\ModHeader-Modify-HTTP-headers-Chrome-Web-Store",
"type": "path"
}
}
}
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.http.jdk.JdkHttpClient$4 send
FINE: Sending text message: {
"method": "webExtension.install",
"id": 1,
"params": {
"extensionData": {
"path": "C:\\Users\\zalma\\Desktop\\ModHeader-Modify-HTTP-headers-Chrome-Web-Store",
"type": "path"
}
}
}
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.http.jdk.JdkHttpClient$4 send
FINE: Websocket response to org.openqa.selenium.remote.http.TextMessage@54f66455 read in 0ms
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.http.jdk.JdkHttpClient$3 onText
FINE: Text message received. Appending data
Oct 29, 2025 10:20:56 PM org.openqa.selenium.remote.http.jdk.JdkHttpClient$3 onText
FINE: Final part of text message received. Calling listener with {"error":"unknown error","id":1,"message":"Manifest file is missing or unreadable","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:5590)\n at CommandProcessor.processCommand (\u003Canonymous>:485:13142)","type":"error"}
Oct 29, 2025 10:20:56 PM org.openqa.selenium.bidi.Connection handle
FINE: <- {"error":"unknown error","id":1,"message":"Manifest file is missing or unreadable","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:5590)\n at CommandProcessor.processCommand (\u003Canonymous>:485:13142)","type":"error"}
org.openqa.selenium.bidi.BiDiException: {"error":"unknown error","id":1,"message":"Manifest file is missing or unreadable","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:5590)\n at CommandProcessor.processCommand (\u003Canonymous>:485:13142)","type":"error"}
Build info: version: '4.38.0', revision: '6b412e825c*'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '21.0.2'
Driver info: driver.version: unknown
at org.openqa.selenium.bidi.Connection.sendAndWait(Connection.java:178)
at org.openqa.selenium.bidi.BiDi.send(BiDi.java:51)
at org.openqa.selenium.bidi.webextension.WebExtension.install(WebExtension.java:42)
at selenium.SeleniumExtensionTest.extTest(SeleniumExtensionTest.java:37)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:664)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at org.testng.TestRunner.privateRun(TestRunner.java:848)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397)
at org.testng.SuiteRunner.run(SuiteRunner.java:336)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1200)
at org.testng.TestNG.runSuites(TestNG.java:1114)
at org.testng.TestNG.run(TestNG.java:1082)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)
Caused by: org.openqa.selenium.WebDriverException: {"error":"unknown error","id":1,"message":"Manifest file is missing or unreadable","stacktrace":"Error\n at new UnknownErrorException (\u003Canonymous>:65:5590)\n at CommandProcessor.processCommand (\u003Canonymous>:485:13142)","type":"error"}
Build info: version: '4.38.0', revision: '6b412e825c*'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '21.0.2'
Driver info: driver.version: unknown
at org.openqa.selenium.bidi.Connection.handleResponse(Connection.java:327)
at org.openqa.selenium.bidi.Connection.handle(Connection.java:302)
at org.openqa.selenium.bidi.Connection$Listener.lambda$onText$0(Connection.java:277)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
dalpil
Metadata
Metadata
Assignees
Labels
B-gridEverything grid and server relatedEverything grid and server relatedC-javaJava BindingsJava BindingsD-chromeG-chromedriverRequires fixes in ChromeDriverRequires fixes in ChromeDriverI-defectSomething is not working as intendedSomething is not working as intended