No targets found in "Selector" under certain conditions (セレクタで参照出来ずエラーが起きてしまう理由)

The following process is looped using “While”


Enter the conditions on the browser and press the download button
●PickBranch A
If the download toolbar is displayed under the browser,
Manipulate toolbar and save dialog to download files
●PickBranch B
If a message appears that the target file does not exist,
Delete a message popup

In this case, if go through “Pick Branch A” and through the dialog or toolbar, the “Attach-Browser” session disappears, or while searching for “Process-A”, the next loop times out without looking for the target.
※If it is only the message popup of “PickBranchB”, “Process-A” will be processed in the next loop without any problem.
この際、"PickBranchA"を通って、ダイアログかツールバーを介してしまうと、"Attach Browser"のセッションが消えてしまうのか、次のループで"Process-A"の処理中に、ターゲットを探せずにタイムアウトエラーを起こしてしまう。

Please let me know if there is an appropriate method to recover the session with IE (“Attach Browser”) after the file download toolbar dialog.
ファイルダウンロードのツールバー・ダイアログを介した後の、IE(“Attach Browser”)とのセッションを回復させる為の、適切な手法があれば教えてください。