activities
latest
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。
UiPath logo, featuring letters U and I in white

ワークフローのアクティビティ

最終更新日時 2026年3月9日

VerifyExpressionWithOperator

演算子を使用して、指定した式と比較してアサートすることにより、式を検証します。

定義

名前空間: UiPath.Testing.API

アセンブリ: UiPath.Testing.Activities.API (UiPath UiPath.Testing.Activities.Api.dll)

オーバー ロード

オーバーロード説明
VerifyExpressionWithOperator(object, Comparison, object, string)演算子を使用して、指定した式と比較してアサートすることにより、式を検証します。
VerifyExpressionWithOperator(object, Comparison, object)``string, bool, string, bool, bool)指定した式と演算子を使用して式をアサートすることで、式を検証します。 出力メッセージ形式の設定や、アサーションが失敗した場合のスクリーンショットの作成など、検証に追加して他の構成を実行することもできます。

VerifyExpressionWithOperator(object, Comparison, object, string)

演算子を使用して、指定した式と比較してアサートすることにより、式を検証します。

bool VerifyExpressionWithOperator(
    Object firstExpression,
    Comparison operatorValue,
    Object secondExpression
       string outputMessageFormat = null
)
bool VerifyExpressionWithOperator(
    Object firstExpression,
    Comparison operatorValue,
    Object secondExpression
       string outputMessageFormat = null
)

firstExpression オブジェクト : 検証プロセスの最初の式です。

operatorValue Comparison : 2 つの式を検証するために使用できる数学演算子です。

secondExpression オブジェクト : 検証プロセスの 2 番目の式です。

outputMessageFormat String : 出力メッセージの形式です。次の引数がサポートされています。

  • {Expression}
  • {ExpressionText}
  • {RightExpression}
  • {RightExpressionText}
  • {Result}
  • {Operator}

詳しくは、「outputMessageFormatを設定する」をご覧ください。

VerifyExpressionWithOperator(object, Comparison, object)string, bool, string, bool, bool)

指定した式と演算子を使用して式をアサートすることで、式を検証します。 出力メッセージ形式の設定や、アサーションが失敗した場合のスクリーンショットの作成など、検証に追加して他の構成を実行することもできます。

bool VerifyExpressionWithOperator(
    Object firstExpression,
    Comparison operatorValue,
    Object secondExpression,
    string outputMessageFormat,
    bool continueOnFailure,
    string alternativeVerificationTitle,
    bool takeScreenshotInCaseOfFailingAssertion,
    bool takeScreenshotInCaseOfSucceedingAssertion
)
bool VerifyExpressionWithOperator(
    Object firstExpression,
    Comparison operatorValue,
    Object secondExpression,
    string outputMessageFormat,
    bool continueOnFailure,
    string alternativeVerificationTitle,
    bool takeScreenshotInCaseOfFailingAssertion,
    bool takeScreenshotInCaseOfSucceedingAssertion
)

firstExpression オブジェクト : 検証プロセスの最初の式です。

operatorValue Comparison : 2 つの式を検証するために使用できる数学演算子です。演算子には、 Comparison オブジェクトを介してアクセスします。次のオプションが利用できます。

  • Contains
  • Equality
  • GreaterThan
  • GreaterThanOrEqual
  • Inequality
  • LessThan
  • LessThanOrEqual
  • RegexMatch

secondExpression オブジェクト : 検証プロセスの 2 番目の式です。

outputMessageFormat String : 出力メッセージの形式。次の引数がサポートされています。

  • {Expression}
  • {ExpressionText}
  • {RightExpression}
  • {RightExpressionText}
  • {Result}
  • {Operator}

詳しくは、「outputMessageFormatを設定する」をご覧ください。

continueOnFailure Boolean : アクティビティでエラーが発生した場合でも、オートメーションを継続するかどうかを指定します。既定値は False です。そのため、フィールドが空白でエラーが発生すると、プロジェクトの実行が停止します。値を True に設定すると、プロジェクトの実行はエラーに関係なく継続されます。

alternativeVerificationTitle String : このタイトルは Orchestrator に表示されます。

takeScreenshotInCaseOfFailingAssertion ブール 値: Trueに設定すると、検証に失敗した場合に対象プロセスのスクリーンショットを作成します。

takeScreenshotInCaseOfSucceedingAssertion ブール 値: Trueに設定すると、検証に成功した場合に対象プロセスのスクリーンショットを作成します。

戻り値

検証が成功/成功した場合は「True」、検証に失敗した場合は「False」です。

outputMessageFormat を設定する

outputMessageFormat パラメーターは、検証操作で使用される値のプレースホルダーとして機能する、サポートされている引数を使用して設定できます。これらのプレースホルダーには、実行時にコード化されたオートメーション API を呼び出すときに定義した変数または値が自動的に入力されます。

コード化されたオートメーション API「VerifyExpressionWithOperator」では、サポートされている次の引数を出力メッセージの作成時に実装できます。

  • {Expression}: firstExpression パラメーターに指定した最初の式の値を表します。
  • {ExpressionText}: firstExpression パラメーターに挿入した最初の式のテキストを表します。
  • {RightExpression}: secondExpression パラメーターに指定した 2 番目の式の値を表します。
  • {RightExpressionText}: secondExpression パラメーターに挿入した 2 番目の式のテキストを表します。
  • {Result}: 検証結果であるコード化されたオートメーション API の戻り値を表します。
  • {Operator: operatorValue パラメーターで設定される、検証で使用される演算子を表します。

以下は、outputMessageFormat パラメーターの設定を含む、コード化されたオートメーション API「VerifyExpressionWithOperator」の使用方法の例です。

// Initialize variables for the expressions to be verified
var expression1 = "User created succesfully";
var expression2 = "successfully created user";

// Employ the VerifyExpressionWithOperator coded automation API, with the last string parameter being the outputMessageFormat
testing.VerifyExpressionWithOperator(expression1, Comparison.Contains, expression2, "{Expression} {Operator} the {RightExpression}, so the verification is {Result}.");
// Initialize variables for the expressions to be verified
var expression1 = "User created succesfully";
var expression2 = "successfully created user";

// Employ the VerifyExpressionWithOperator coded automation API, with the last string parameter being the outputMessageFormat
testing.VerifyExpressionWithOperator(expression1, Comparison.Contains, expression2, "{Expression} {Operator} the {RightExpression}, so the verification is {Result}.");

この例では、中括弧内のプレースホルダーが実行時に対応する変数名とその値に置き換えられ、カスタマイズされた出力メッセージが提供されます。

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得