2014-12-29 46 views
1

我試圖執行這個和平的機器人框架代碼。 我總是在 「運行關鍵字」上遇到錯誤如果語句 錯誤信息:沒有關鍵字,名稱爲'運行關鍵字'如果'$ {checkmessageoutput}'=='發現了預期的飛機ID,即MLH001''。可以「運行關鍵字如果」不運行Robotframework代碼的關鍵字部分

任何幫助將不勝感激。

是沒可能使用

*** Settings *** 

Documentation  A Test of the TAS-APP-FDD-3 
...    Kari Dec 2014 

Suite Setup  fdd attach to application 

Library   BuiltIn 
Library   fddlibrary 

*** Test Cases *** 
Send a valid flight plan 
    [Template] send a flightplan 
    FI352 \ 

Fill out a flight plan missing callsign 
    [Template] send a flightplan 
    / Expected aircraft ID, i.e. MLH001 

*** Keyword *** 
fill out flight plan 
    fdd select msg 
    fdd msg select fpl 
    fdd msg fpl priority     FF 
    fdd msg fpl ssr      1234 
    fdd msg fpl flightrules    I 
    fdd msg fpl flighttype    S 
    #fdd msg fpl callsign     FI351 
    fdd msg fpl aircrafttype    A310 
    fdd msg fpl wakecategory    H 
    fdd msg fpl equipmentcommnav   SHIR 
    fdd msg fpl equipmentsurveillance  S 
    fdd msg fpl departureairport   BIKF 
    fdd msg fpl departuretime    0800 
    fdd msg fpl crusingspeed    M080 
    fdd msg fpl cruisinglevel    F300 
    fdd msg fpl route      ALDAN RATSO 
    fdd msg fpl destinationairport  EKCH 
    fdd msg fpl eet      0300 
    fdd msg fpl otherinformation   Flightplan 1 

send a flightplan 
    [arguments]  ${callsign}  ${checkmessageoutput} 
    fill out flight plan 
    fdd msg fpl callsign    ${callsign} 
    check flight plan     ${checkmessageoutput} 
    Run Keyword If '${checkmessageoutput}' == 'Expected aircraft ID, i.e. MLH001'  log to console  \nRun send flight plan 
    ELSE log to console  \nRun send no flight plan  

check flight plan 
    [arguments]      ${checkmessageoutput} 
    fdd msg fpl check message 
    ${message}=  fdd msg fpl return message 
    Should be equal  ${message} ${checkmessageoutput}  

send flight plan 
    fdd msg fpl send message 

display strip  
    fdd select flights 
    fdd flights display electronic strip 

回答

2

在錯誤信息仔細看:

No keyword with name 'Run Keyword If '${checkmessageoutput}' == 'Expected aircraft ID, i.e. MLH001'' found. 

注意到它的說有沒有關鍵字命名Run Keyword If,而是Run Keyword If '${check...。換句話說,你錯過了關鍵字和它的參數之間的分隔符,所以它認爲整個句子是一個關鍵字。在Run Keyword If之後添加另一個空間或標籤或任何您正在使用的內容。

這些類型的錯誤是爲什麼我建議使用管道分隔格式 - 這種類型的錯誤幾乎從不發生,並且它更容易診斷。

相關問題