bug: <title>After upgrading Appium-Python-Client 2.11.1, webview execution scrollIntoView reported an error, 'selenium. common. exceptions. JavascriptException: Message: JavaScript error: arguments [0]. scrollIntoView is not a function
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 1.8k
- Fork
- 570
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 24
Mô tả
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 npmversion (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)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Start with public/common.py at scroll_into_view and the caller in test_page/LPLoginPage_app01.py, then trace the execute_script path in the Appium Python client and Selenium WebDriver. Reproduce the failure using the supplied Android webview example and determine whether the issue is in argument conversion or webview execution; done means the reported scroll operation works with the affected versions and has regression coverage if the repository provides a suitable test location.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- mobile-dev, testing-qa
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100