I am looking for advice on what strategy to use to handle Login Sequences for Web Applications that may auto log in or “remain logged in after the application is closed”.
Suppose:
- When I go to a web application, such as acme-test.uipath.com, and I expect to be in one of three states:
a. A login screen
b. The Dashboard, because I am still logged in from the last time I used the application.
c. Some other screen that is neither login nor dashboard (Maybe a 404, or a site maintenance screen, or what ever!)
I would like my login sequence to ask, “are either of these two unique elements in the web page?” If one of them is on the page, tell me which element. If neither are on the page, wait timeout milliseconds for them to appear, and if after that amount of time, neither are on the page, timeout.
I can easily write a sequence that checks for the first element, then checks for the second element, and then performs my logic. BUT, the first element exists has a time out of 30 seconds, and the second element exists has a time out of 30 seconds making this process slow, slow, slow! Even if I get one of the expected screens/elements it would still take 30 seconds. That is really bad.
Any advice?
I can easily image taking the Element Exists code from the UiPath Element Exists activity and modifying it to take an array of elements (really thinking Selectors, but idea is the same) and doing exactly what I want while creating a new activity for everyone. But I don’t think the UiPath activity code is public