appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.21k stars 756 forks source link

webDriver.executeScript throws #2097

Closed TerryQuiet closed 8 months ago

TerryQuiet commented 8 months ago

Description

After updating from appium from 8.1.1 to 9.0.0 and selenium from 4.2.1 to 4.16.1 command webDriver.executeScript("arguments[0].scrollIntoViewIfNeeded(true);", webElement)

throws

org.openqa.selenium.JavascriptException: javascript error: arguments[0].scrollIntoViewIfNeeded is not a function
  (Session info: chrome=120.0.6099.144)
  (Driver info: chromedriver=120.0.6099.71 (9729082fe6174c0a371fc66501f5efc5d69d3d2b-refs/branch-heads/6099_56@{#13}),platform=Linux 6.6.9-200.fc39.x86_64 x86_64)
Build info: version: '4.16.1', revision: '9b4c83354e'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.9-200.fc39.x86_64', java.version: '17.0.9'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [0476c686-27d6-4f4f-9915-1443bce6f5eb, executeScript {script=arguments[0].scrollIntoViewIfNeeded(true);, args=[{element-6066-11e4-a52e-4f735466cecf=B983E0314898041FF42EC202BAB51679_element_13}]}]
Capabilities {appium:adbExecTimeout: 60000, appium:androidInstallTimeout: 180000, appium:appActivity: com.lalal.hnod.wm.activities..., appium:appPackage: com.lalal.hnod.wm, appium:appWaitForLaunch: true, appium:autoGrantPermissions: true, appium:automationName: UIAutomator2, appium:chromeLoggingPrefs: {driver: DEBUG}, appium:chromeOptions: {w3c: false}, appium:chromedriverArgs: [--log-path=logs/chromedrive..., --readable-timestamp, --verbose], appium:chromedriverExecutableDir: /usr/local/sdk/chromedriver, appium:chromedriver_autodownload: true, appium:clearDeviceLogsOnStart: true, appium:databaseEnabled: false, appium:desired: {adbExecTimeout: 60000, androidInstallTimeout: 180000, appActivity: com.lalal.hnod.wm.activities..., appPackage: com.lalal.hnod.wm, appWaitForLaunch: true, autoGrantPermissions: true, automationName: UIAutomator2, chromeLoggingPrefs: {driver: DEBUG}, chromeOptions: {w3c: false}, chromedriverArgs: [--log-path=logs/chromedrive..., --readable-timestamp, --verbose], chromedriverExecutableDir: /usr/local/sdk/chromedriver, chromedriver_autodownload: true, clearDeviceLogsOnStart: true, dontStopAppOnReset: true, enforceAppInstall: false, fullReset: false, gpsEnabled: true, mockLocationApp: io.appium.settings, nativeWebScreenshot: true, newCommandTimeout: 600, noReset: false, platformName: ANDROID, showChromedriverLog: true}, appium:deviceApiLevel: 33, appium:deviceManufacturer: samsung, appium:deviceModel: SM-T577U, appium:deviceName: R52R601F2JY, appium:deviceScreenDensity: 320, appium:deviceScreenSize: 1920x1200, appium:deviceUDID: R52R601F2JY, appium:dontStopAppOnReset: true, appium:enforceAppInstall: false, appium:fullReset: false, appium:gpsEnabled: true, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:mockLocationApp: io.appium.settings, appium:nativeWebScreenshot: true, appium:networkConnectionEnabled: true, appium:newCommandTimeout: 600, appium:noReset: false, appium:pixelRatio: 2, appium:platformVersion: 13, appium:showChromedriverLog: true, appium:statBarHeight: 48, appium:takesScreenshot: true, appium:viewportRect: {height: 1152, left: 0, top: 48, width: 1920}, appium:warnings: {}, appium:webStorageEnabled: false, platformName: ANDROID}
Session ID: 0476c686-27d6-4f4f-9915-1443bce6f5eb

Environment

TerryQuiet commented 8 months ago

okay, that is my mistake. I had "w3c" to false