Getting an error Cannot call non W3C standard command while in W3C mode

When running my test script, I am getting the below mentioned error on this command : int deviceHeight = driver.manage().window().getSize().getHeight() / 2; it seems like the command is not supported

Exception in thread “main” org.openqa.selenium.UnsupportedCommandException: unknown command: Cannot call non W3C standard command while in W3C mode (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’ System info: host: ‘LENOVODEV01’, ip: ‘192.168.1.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘15.0.1’ Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities {appActivity: com.google.android.apps.chr…, appPackage: com.android.chrome, browserName: Chrome, chromeOptions: {args: [–proxy-server=10.0.2.2:8080, --proxy-bypass-list=<-loopb…]}, databaseEnabled: false, desired: {appActivity: com.android.browser.Browser…, browserName: Chrome, chromeOptions: {args: [–proxy-server=10.0.2.2:8080, --proxy-bypass-list=<-loopb…]}, deviceName: Galaxy S20 Plus, deviceReadyTimeout: 120, fullReset: false, headless: false, launchTimeout: 300, nativeWebScreenshot: true, newCommandTimeout: 300, performance: false, platform: ANY, platformName: Android, platformVersion: 10, shutdownOtherSimulators: true, useNewWDA: true, waitForQuiescence: false, wdaLaunchTimeout: 120000}, deviceApiLevel: 29, deviceManufacturer: Google, deviceModel: Android SDK built for x86, deviceName: emulator-5554, deviceReadyTimeout: 120, deviceScreenDensity: 480, deviceScreenSize: 1440x3200, deviceUDID: emulator-5554, fullReset: false, headless: false, javascriptEnabled: true, launchTimeout: 300, locationContextEnabled: false, nativeWebScreenshot: true, networkConnectionEnabled: true, newCommandTimeout: 300, performance: false, pixelRatio: 3, platform: ANY, platformName: ANY, platformVersion: 10, shutdownOtherSimulators: true, statBarHeight: 72, takesScreenshot: true, useNewWDA: true, viewportRect: {height: 2984, left: 0, top: 72, width: 1440}, waitForQuiescence: false, warnings: {}, wdaLaunchTimeout: 120000, webStorageEnabled: false}

Hey Tom,

Post checking the error message and logs shared, it seems that adding the w3c capability would resolve the issue. Kindly use the capability w3c: true