2017-09-07 13 views
1

ロボットフレームワークを使用して、Webページが正しく開くかどうかをテストしています。計画通りにすべてが動作するかどうかのWebページは、2つの可能な結果を​​持っていますロボットフレームワークで2つのブール値を結合する方法

${element_1_visible} = Run Keyword And Return Status  Element should be visible  element_1 
${element_2_visible} = Run Keyword And Return Status  Element should be visible  element_2 

これらの変数は、そう簡単なor操作が十分でなければならず、常にTrueFalseです。私のページが動作するかどうかをテストするために、これら2つのブール値をどのように組み合わせますか?これまで試してみました。また、

Should be True ${element_1_visible}  or  ${element_2_visible} 
Should be True ${element_1_visible} == True  or  ${element_2_visible} == True 

${result} = ${element_1_visible}  or  ${element_2_visible} 
Should be True ${result} 

答えて

3

単一の引数でなければなりません評価する必要声明を。これは、複数のスペースを避けることを意味します。なぜなら、2つ以上の連続するスペースは、引数間の分割子であるからです。

例を更新しましたが、これで機能します。

*** Test Cases *** 
TC 
    ${element_1_visible}  Set Variable  ${True} 
    ${element_2_visible}  Set Variable  ${False} 

    Should be True  ${element_1_visible} or ${element_2_visible} 
    Should be True  ${element_1_visible}==True or ${element_2_visible}==True 

    ${element_1_visible}  Set Variable  ${False} 
    ${element_2_visible}  Set Variable  ${False} 

    Should not be True  ${element_1_visible} or ${element_2_visible} 
    Should not be True  ${element_1_visible}==True or ${element_2_visible}==True 
+0

素晴らしいです。 – tarikki

関連する問題