第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 Robot Framework 從 Python 中的方法返回值

使用 Robot Framework 從 Python 中的方法返回值

慕碼人8056858 2021-06-30 17:42:46
所以可以說我在python中有這個方法def get_data(notificaition):    print("Notification Recived: ", notificaition)然后我有另一種方法可以接收事件并獲取該事件的值。def verify_singal_r():    with Session() as session:        connection = Connection("http://example/signalr", session)        print(connection)        logging.info("got the connection")        presenceservice = connection.register_hub('MyHub')        connection.start()        def print_error(error):            print('error: ', error)        connection.error += print_error        # TODO: NEED TO ADD POST REQUEST HERE        presenceservice.client.on('Notified', get_data)        connection.wait(10)一旦關(guān)鍵字Verify_Signal運行,我就會得到我需要的值并將它們打印到控制臺上如何使用get_data機器人框架中的值?我試著簡單地使用*** Test Cases ***Get Event Back     verify_singal_r     get_data但這不起作用,因為 get_data 需要參數(shù)。
查看完整描述

2 回答

?
料青山看我應(yīng)如是

TA貢獻1772條經(jīng)驗 獲得超8個贊

你的職能


def get_data(notificaition):

    print("Notification Recived: ", notificaition)

期待爭論


但是,當您在機器人框架中調(diào)用它時


*** Test Cases ***


Get Event Back

     verify_singal_r

     get_data

你沒有提供任何論據(jù)。


你可以試試這樣的


*** Variables ***

${notification}    Test

*** Test Cases ***


Get Event Back

     verify_singal_r

     get_data    ${notification}

這將解決您的問題。


查看完整回答
反對 回復(fù) 2021-07-06
?
縹緲止盈

TA貢獻2041條經(jīng)驗 獲得超4個贊

你的方法


def get_data(notificaition):

    print("Notification Recived: ", notificaition)

不返回任何內(nèi)容,因此機器人框架關(guān)鍵字也不會返回任何內(nèi)容。


查看完整回答
反對 回復(fù) 2021-07-06
  • 2 回答
  • 0 關(guān)注
  • 231 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號