22-05-24 10:00 AM
Hi,
I'm trying to make one of our robot login in a web application. It has to be done via the form as shown below:
I can fill username and password just fine. The only way I can make the robot click on the Login button is via the region mode. The goal is to make this robot run on a locked desktop so I have to find another way.
I've tried it via Browser mode and when I identify the Login button it works (it gives the outline on the button). But when I run the robot it does not click/does not login.
So I've looked at the DOM/xpath and I see slot tags:
Not sure if these tags cause the problem but they only surround this button and I haven't seen them any where else.
I've tried this via Javascript insert/invoke but I run into CSP. For now I am not sure how to work around this. UIA mode doesn't work either.
Does anyone have an idea how to solve this?
Your help is be highly appreciated.
22-05-24 03:29 PM - edited 22-05-24 03:30 PM
Dear @Dirk-Jan
I would like to suggest checking how your able to login manually by clicking on the login button. I mean please observe the application carefully on which portion of the login Button your exactly clicking Manually.
Please spy the element with all available setions in Login button for example inner side , outer side and middle portion of the login button with Browse mode.
Try to click on the login button and see the results.
I would suggest going with Browse or UI Mode for this login activity.
Please try the results and let me know if you face any errors.
22-05-24 03:32 PM
Depending on the listener events used, it can sometimes get tricky to get the right combination. One method I am going to suggest is the Focus/Global Send Keys combination but it needs to tested out manually first.
If the ENTER key activates the login button you can try the Focus/Global Send Keys combination. In a navigate stage, add a "Focus" action and a "Global Send Keys" action (sending the ENTER key) using your login button element. Make sure there is a small wait in the "Pause After Each Step" field of the navigate stage.
Debugging this gets tricky because most people don't realize that the Global Send Keys action uses the .NET Framework's SendKeys.SendWait method which works on the active application and not on the application the element is in. You can't step over this navigate stage because Blue Prism Studio is the active application so you need to set the next stage to a few stages before the navigate stage, run to a stage just after it and quickly click somewhere on the browser window, to make it the active application, just before it hits the stage in studio.
Also, may I suggest the following XPath expression for the login button element:
//button[@title='Login at Inhuur']
23-05-24 09:53 AM
I think I'm closer to a solution.
After filling username and password I selected the password field and pressed tab. And then enter. That works.
I also added a sleep stage and did a manual click on the browser. After that is stage with a focus on the button and a global send keys with "{ENTER}". After that it logged in.
Replaced the sleep stage with an activate stage so I now have:
This works but only with an unlocked screen. Do you have any suggestions on how to make this work with a locked screen?
Thank you for your help so far! It helped a lot!
23-05-24 10:42 AM
Hi @Dirk-Jan ,
What do you mean by Locked Screen? Is it a physical machine? or the process runs on a VM?
23-05-24 10:47 AM
This process runs on a physical Windows 10 desktop. That desktop is supposed to be locked.
23-05-24 11:09 AM
Ahh...now it make sense.
Similarly we have had a physical machine which runs process on it.
The approach which we have had there was:
Have you tried the Login Agent Unlock Screen Action:
Unlocking the Windows Session:
The Login Agent can unlock a Windows session using predefined credentials. This involves sending the username, password, and domain information to the login screen to authenticate and unlock the session. Once the session is unlocked try to make the process runs as per the steps mentioned by @MichealCharron to interact with the screen.
When a machine is locked, most automation actions that require UI interaction will fail because they can't interact with the elements on the screen. By unlocking the screen, the Login Agent ensures that the desktop environment is accessible, allowing the automation process to proceed as if a user is actively using the machine.