I am trying to perform web automation where I need to click on an image after the page loads. When I click on the run(F5) button, sometimes the browser opens in foreground and the bot is able to recognize the image and click on it. But, many times, the browser opens but it is not in the foreground and the bot waits till the timeout and then throws an error. However, during the timeout period, if I click on the browser button in the task bar and maximize it, the bot is able to recognize the image and click on it. How do I always open the browser in the foreground?
Any help will be highly appreciated.