Continuous Execution of Sequential Scripts in UI.Vision Tool with Restart Mechanism for Element Loss

Through the ui.vison tool, write 5 different scripts, each script belongs to a step, and execute them in sequence from 1 to 5. They should run continuously every day, and will not stop halfway, but after running for some time, they may encounter the situation of losing the element, which needs to be restarted to work again. Is there a better solution for this situation?

You may want to use a .bat script on Windows using a separate browser profile for each execution. I use one that functions by opening 24 tabs for 30 minutes, then closing all of them, and subsequently opening another set of 24 tabs for an additional 30 minutes, followed by closing them and returning to the initial set of 24 tabs. You can achieve this by utilizing an html initialization file for UI Vision, which can be obtained within the extension.

@echo off
color 02
set WINDOW_TITLE=VisyonBot

call :run_profiles 1 10
timeout /t %WAIT_TIME_LONG% /nobreak
call :close_chrome

timeout /t 15 /nobreak

call :run_profiles 11 20
timeout /t %WAIT_TIME_LONG% /nobreak
call :close_chrome

goto loop

set START=%1
set END=%2

if %START% gtr %END% goto :eof

start “” “C:\Program Files\Google\Chrome\Application\chrome.exe” --profile-directory=“Profile %START%” “file:///C:/Users/noar/Documents/”
timeout /t %WAIT_TIME_SHORT% /nobreak

set /a START+=1
goto run_loop

taskkill /f /im chrome.exe
timeout /t 30 /nobreak
goto :eof

use gpt chat to create one for your automation case

Thank you for your response! I have a process with multiple steps, each of which may take a different amount of time to complete. I don’t have a way to know if the previous step has finished before starting the next one, so I end up using the ‘run’ command continuously from step 1 to step 5. When I reach step 5, I need to go back to step 1 and start over. I am looking for a way to introduce a delay of 1 minute or 5 minutes between each step so that the next step starts only after the previous one has completed.