【发布时间】:2016-01-05 20:50:05
【问题描述】:
我在 python 中自动化 pressKeyButton()。因为下面是代码
from AppiumLibrary import AppiumLibrary
def PressKeyboardButton(self, buttonToPress):
self._current_application().execute_script("var vKeyboard = target.frontMostApp().keyboard(); vKeyboard.buttons()['" + buttonToPress + "'].tap();");
执行后出现如下异常:
AttributeError: 'unicode' object has no attribute '_current_application'
任何人都可以建议我解决方案。
【问题讨论】:
-
嗯...没有
self因为你不在课堂上...!? -
我已经从函数的参数中删除了 self,但我仍然有相同的探针
标签: python appium python-appium