Description
Do I have the most recent component updates?
- I use the most recent available driver/plugin and server versions
Is the component officially supported by the Appium team?
- I have verified the component repository is present under the Appium organization in GitHub
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
After upgrading selenium 4, webview execution scrollIntoView reported an error, 'selenium. common. exceptions. JavascriptException: Message: JavaScript error: arguments [0]. scrollIntoView is not a function
Expected Behavior
Realize sliding
Minimal Reproducible Example
caps = {}
caps["platformName"] = "Android"
caps["appPackage"] = "com.picc.mcp"
caps["appActivity"] = "com.picc.mcp.IndexVideoActivity"
caps["noReset"] = True
caps["unicodeKeyboard"] = True
caps["resetKeyboard"] = True
caps["newCommandTimeout"] = 180
caps["adbExecTimeout"] = 180000
caps["logcatFormat"] = "time"
caps["logcatFilterSpecs"] = ['*:E']
caps["clearDeviceLogsOnStart"] = True
caps["chromeOptions"] = {"w3c": False}
driver = webdriver.Remote(host, caps)
driver.implicitly_wait(global_wait)
driver.switch_to.context('WEBVIEW_com.picc.mcp')
driver.implicitly_wait(global_wait)
ele = get_element(driver, 'xpath', '//a[contains(@href,"com.picc.mcp/files/mcph5/login.html")]')
str1 = 'return arguments[0].scrollIntoView();'
driver.execute_script(str1, ele)
Environment
- Operating system:win10
- Appium server version (output of
appium --version
):1.22.0 - Appium driver(s) and their version(s):
- Appium plugin(s) and their version(s):
- Node.js version (output of
node --version
):v14.16.0 npm
version (output ofnpm --version
):6.14.11- Last component(s) version which did not exhibit the problem:appnium 1.3.0
- Platform and version under test:Internally used apps 6.1.1.0
- Real device or emulator/simulator:华为nova 4
Link to Appium Logs
No response
Further Information
Traceback (most recent call last):
File "D:\YR\UITestAND_PICC_LP_APP01\UITestAND_PICC_LP_APP15\public\MyTestCase.py", line 27, in testPartExecutor
yield
File "D:\YR\UITestAND_PICC_LP_APP01\UITestAND_PICC_LP_APP15\public\MyTestCase.py", line 196, in run
self.setUp()
File "D:\YR\UITestAND_PICC_LP_APP01\UITestAND_PICC_LP_APP15\test_case\LP_CDYT_case_NEW\LP_CDYT_case_NEW_S_04.py", line 79, in setUp
LPLoginPage(self.logging).login_collection(self.driver, self.data['app_user'], self.data['app_pwd'],
File "D:\YR\UITestAND_PICC_LP_APP01\UITestAND_PICC_LP_APP15\test_page\LPLoginPage_app01.py", line 174, in login_collection
self.click_back_login(driver,type1=type1)
File "D:\YR\UITestAND_PICC_LP_APP01\UITestAND_PICC_LP_APP15\test_page\LPLoginPage_app01.py", line 157, in click_back_login
scroll_into_view(driver,ele)
File "D:\YR\UITestAND_PICC_LP_APP01\UITestAND_PICC_LP_APP15\public\common.py", line 650, in scroll_into_view
driver.execute_script(str1, e)
File "C:\yurui\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 405, in execute_script
return self.execute(command, {"script": script, "args": converted_args})["value"]
File "C:\yurui\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute
self.error_handler.check_response(response)
File "C:\yurui\Python\Python39\lib\site-packages\appium\webdriver\errorhandler.py", line 122, in check_response
raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
selenium.common.exceptions.JavascriptException: Message: javascript error: arguments[0].scrollIntoView is not a function
(Session info: chrome=78.0.3904.108)
(Driver info: chromedriver=78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904@{#877}),platform=Windows NT 10.0.19045 x86_64)
Stacktrace:
JavaScriptError: javascript error: arguments[0].scrollIntoView is not a function
(Session info: chrome=78.0.3904.108)
(Driver info: chromedriver=78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904@{#877}),platform=Windows NT 10.0.19045 x86_64)
at errorFromMJSONWPStatusCode (C:\Users\admin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:764:12)
at ProxyRequestError.getActualError (C:\Users\admin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:661:14)
at JWProxy.command (C:\Users\admin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:272:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at AndroidUiautomator2Driver.execute (C:\Users\admin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-driver\lib\commands\execute.js:19:10)