You build a small web automation. Use Application/Browser opens the page, a Get Text reads a title, and the text is on screen almost right away. The run still sits there for ages, and sometimes it ends in a timeout. The page has an embedded video player, a chat widget or ads that keep loading.
The natural move is to open Use Application/Browser and look for a "wait for the page" setting. That's the pitfall. In the Use Application/Browser docs, the scope's properties include a Timeout (30 seconds by default), but Wait for page load isn't one of them.
Where the setting actually lives
Wait for page load is a property on each UI activity inside the scope: Get Text, Click, Type Into, Check App State and the rest. Before the activity does its thing, it waits for the app to be ready to accept input. There are three options:
None : does not wait for the target to be ready
Interactive : waits until only a part of the app is loaded
Complete : waits for the entire app to be loaded
On a page that keeps pulling in a player or widgets, Complete is the one that waits for all of it. If the text you need shows up early, set the activities that run against that page to Interactive and try again.
Change it once for the project
You don't have to touch every activity. In the Project panel open Project Settings, go to Activities Settings > UI Automation Modern, and set Wait for page load there. The UI Automation Modern project settings page has the catch in an Important note: project settings only apply to activities whose properties haven't been edited. If you already changed Wait for page load on an activity by hand, that activity keeps its own value, so check those first when the new default doesn't seem to do anything.
Wait for the element, not the page
The opposite problem shows up too. In a Salesforce thread on the forum, the poster found that Complete came back while the nested frames were still loading, and the click fired too early. Page readiness isn't the same as "the thing I need is there."
When that happens, wait for the element itself. Check App State set to Element to appear runs the Target appears block when it finds the element and Target does not appear when it doesn't. Its Timeout defaults to 5 seconds, so raise it for slow pages:
Check App State
Wait for : Element to appear
Target : the title or button you need next
Timeout (sec) : 30
Target appears -> Get Text / Click
Target does not appear -> Throw or log and retry
With that in place you can leave Wait for page load at Interactive or even None on the next activity. None only skips the readiness wait; the activity still has its own Timeout (30 seconds by default for Get Text) to find its target.
Have you hit a page that never seems to finish loading? Share what you ended up waiting for in the original forum thread.
Originally posted on the UiPath Forum: https://forum.uipath.com/t/uipath-pitfall-of-the-week-7-looking-for-wait-for-page-load-on-use-application-browser/5793706
Top comments (0)