ダウンロードを待機

ダウンロードが完了に対して定義されたタイムアウトまで待機します。

コマンドの可用性: IBM RPA SaaS および IBM RPA オンプレミス

スクリプト構文

IBM RPA の専有スクリプト言語の構文は、他のプログラミング言語と似ています。 スクリプト構文は、スクリプト・ファイル内のコマンドの構文を定義します。 この構文は、 IBM RPA Studioの 「スクリプト」 モードで操作できます。

webWaitDownload [--saveto(String)] [--nametosave(String)] [--expectedfilename(String)] --extension(String) [--timeout(TimeSpan)] (String)=filename (Boolean)=success

依存関係

「ダウンロードを待機」 (webWaitDownload) コマンドを使用する前に、「ブラウザーの開始」 (webStart) コマンドを使用してブラウザーを開始するか、「Internet Explorer ブラウザーの検索」 (findBrowser) コマンドを使用して Microsoft Internet Explorer を関連付けます。

入力パラメーター

以下の表は、このコマンドで使用可能な入力パラメーターのリストを示しています。 この表では、 IBM RPA Studioのスクリプト・モードで作業しているときのパラメーター名と、それに相当する Designer モードのラベルを確認できます。

「デザイナー」モードのラベル 「スクリプト」モードの名前 必須 使用可能な変数タイプ 説明
保存先 saveto Optional Text ダウンロード後にファイルを保存するディレクトリー。
ファイル名 nametosave Optional Text ダウンロード後のファイル名。

名前を入力しない場合、コマンドにより、ダウンロードされたファイルのランダム名が自動的に生成されます。
元のファイル名 expectedfilename Optional Text ダウンロードが完了したかどうかを定義するためにコマンドが検索する元のファイル名。
ファイル拡張子 extension Required Text ダウンロードしたファイルの拡張子。
タイムアウト timeout Optional Time Span, Number, Text ダウンロードの検証のタイムアウト。

出力パラメーター

「デザイナー」モードのラベル 「スクリプト」モードの名前 使用可能な変数タイプ 説明
ファイル filename Text ダウンロード後にファイルを保管するパスを返します。
成功 success Boolean ファイルが正常にダウンロードされた場合は True 、それ以外の場合は False を返します。

次の例は、 Google Chrome ブラウザー・インストーラーのダウンロードを待つコマンドを示している。

defVar --name desktopPath --type String
defVar --name successDownload --type Boolean
defVar --name file --type String
// Use the desktop path to save the downloaded file.
getSpecialFolder --folder "Desktop" desktopPath=value
// Starts the browser Google Chrome
webStart --name browser --type "Chrome"
// Navigates to the Google web page.
webNavigate --url "https://www.google.com/?gl=us&hl=en&pws=0&gws_rd=cr"
// Look for Chrome, the example will download the installer for that browser.
webSet --value Chrome --selector "Name" --name q
webClick --selector "NameAndValue" --name btnI --elementvalue "I\'m Feeling Lucky"
webClick --selector "Id" --id "js-download-hero"
// As it is an executable, the extension is .exe
// Note that even if the file has a name, the name parameter is empty, so a random name is generated.
webWaitDownload --saveto "${desktopPath}" --extension ".exe" --timeout "00:01:00" file=filename successDownload=success
webClose --name browser
// The console displays the file name and if the download was completed.
logMessage --message "\r\n----------------\r\nFile: ${file}\r\n----------------\r\nSuccess: ${successDownload}" --type "Info"

制限

コマンドが同じフォルダーに 2 つのファイルを同時にダウンロードしていて、両方のファイル名が指定されていない場合、コマンドはファイルの 1 つのみをダウンロードします。