【发布时间】:2021-11-24 03:30:25
【问题描述】:
我已经创建了一个包含以下内容的 python 文件
from robot.libraries.BuiltIn import BuiltIn
def scroll_page_to_the_bottom():
BuiltIn().get_library_instance('AppiumLibrary').execute_script("mobile: scroll", {'direction': 'down'})
当我使用关键字 scroll_page_to_the_bottom 从机器人文件调用时,我收到错误 TypeError: too many positional arguments
我认为我的脚本有问题,我尝试使用其他移动命令,例如 mobile: deviceInfo,它运行良好
这是我的代码BuiltIn().get_library_instance('AppiumLibrary').execute_script("mobile: deviceInfo")中的工作执行脚本@
我的问题是如何将带有参数的命令传递给execute_script?
参考http://appium.io/docs/en/commands/mobile-command/index.html,我使用了正确的格式execute_script("mobile: scroll", {'direction': 'down'}),但机器人执行时出现错误TypeError: too many positional arguments
【问题讨论】:
-
请显示完整的实际错误。
-
@BryanOakley 这是错误 TypeError: too many positional arguments
标签: python appium robotframework appium-android python-appium