如何在一行中使用两种或更多种方法

时间:2019-12-11 13:02:26

标签: python python-behave

我有这部分代码

def step_impl(context):
    context.announcement_page.select_art_file_on_newsfeed_tile().select_available_image(Locators.image_news_feed_banner_locator)

当我运行它时,我得到了AttributeError:'function'对象没有属性'select_available_image' 问题是如何在一行中使用多种方法??

我可以这样使用它:

context.announcement_page.select_art_file_on_newsfeed_tile
context.announcement_page.select_available_image(Locators.image_news_feed_banner_locator)

但这不是我想要的

def select_art_file_on_newsfeed_tile(self):
choose_art_file = self.find_element('//div[contains(text(), "Choose Art File")]')
        choose_art_file.click()

0 个答案:

没有答案