无法使用扩展AppiumLibrary的自定义Robot框架库单击元素

2024-05-16 04:01:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在Python中编写我的自定义Robot Framework库。
我正在扩展AppiumLibrary,并试图编写一个函数,从活动中单击id为countryGermany的元素。
目前我得到一个错误:Element 'countryGermany' did not appear in 5 seconds。我也尝试了id=countryGermany选择器,同样的错误。你知道吗

我的代码如下所示:

from PageObject import PageObject

class Foo(PageObject):
def choose_country(self):
    self.open_application('http://localhost:4723/wd/hub', platformName='Android', deviceName='CB512A784E', appPackage='com.example.MyApplication', appActivity='.MainActivity')
    self.wait_until_page_contains_element('bar')
    return self.tap('bar')

如何单击该元素?你知道吗


Tags: 函数selfid元素错误notbarrobot