Check if the user name and password is valid

Hello Experts,

I have situation where I need to validate the user name and password. I have stored the credentials in the Asset (Orchestrator).

When there is a logon failure then I can check for a certain UI element, however when everything goes well then I will not be able to read the logon failure element and I cannot continue and it gives me error, how do I handle such situations.

Regards,
Manjesh

Use the element exists activity and point it to your ‘certain UI element’. It will output a boolean value that you can save in a variable for a later flow.

Your full flow will look something like:

  • //Login Steps
  • var logonFailure = Element Exists (‘certain UI element’)
  • if(logonFailure)
  • //Handle Exception Case
  • else
  • //Handle Success Case
  • End if
  • End
1 Like

Do it the other way around. Find an element on the page that shows up when login is successful. This is more efficient because it’s assumed the login will be successful more often than it fails. Then just use an Element Exists activity to look for that element, store the result (boolean) in a variable like “loginSuccessful” and then check its value with an If.

2 Likes

Yes, this is way better, more optimized! :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.