タイムアウトの設定

verb: setTimeout

使用可能: < 標準>

タイムアウト・パラメーターを設定したスクリプト内のすべてのコマンドに対して、デフォルトのタイムアウトを設定します。

構文

setTimeout --timeout(TimeSpan)

入力

スクリプト Designer 必須 AcceptedTypes 説明
--timeout タイムアウト 必須 時間幅 スクリプト内で使用するデフォルトのタイムアウト。

「ブラウザーの開始」 コマンドはブラウザーを開始し、 「Navigate」 コマンドは Web サイト「https://www.ibm.com」にアクセスします。 「Wait for Element in a Web Page」 コマンドは、要素が見つからない場合にデフォルトの時間 (00:00:05) のロゴ要素を待機し、 Set Timeout コマンドを使用してデフォルトのタイムアウトを 30 秒に変更します。

defVar --name IBMLogo --type Boolean
defVar --name IBMLogoUpdatedTimeout --type Boolean
webStart --name browser --type "Chrome"
webNavigate --url "https://www.ibm.com"
webWaitElement --selector "Id" --id logo IBMLogo=value
if --left "${IBMLogo}" --operator "Is_True" --negate
	setTimeout --timeout 00:00:30
	webWaitElement --selector "Id" --id logo IBMLogoUpdatedTimeout=value
	assert --message "Could not load page" --left "${IBMLogoUpdatedTimeout}" --operator "Is_True"
endIf
logMessage --message "Found on first timeout: ${IBMLogo}\r\nFound on updated timeout: ${IBMLogoUpdatedTimeout}" --type "Info"
webClose --name browser --leavebrowseropen

注釈

コマンドのタイムアウト・パラメーターに時間が直接設定されている場合は、タイムアウトの設定 によって変更されません。