cancel
Showing results for 
Search instead for 
Did you mean: 

Need help automating a javascript login scree

PeterHacker1
Level 3
Hello All,

I'm trying to automate an incorta login screen, but it is a javascript application:
30877.png

Using a write stage populates the fields just fine, but my issue is the "Sign In" button. In order for the button go become active, it requires. what I've read, is a javascript callback" action. This action is a physical keystroke in the Password field. I've also read that the write stage output is not recognized as a physical keystrokes. I've tried every technique I could think of, and some new ones I've discovered with no results. These include Send Key Events to the Window, Window Press Keys to the Window, Global Send Keys (tab) to the Password field, all sorts of combinations of Focus, Click, Select, Verify, etc. I've also seen suggestions of a combination of Insert Javascript Fragment/Invoke Javascript Function, but there's never enough detail to explain how this actually works. If anyone has some insight, it would be much appreciated. I'm trying to develop a prototype that shows how RPA can drive a Business Intelligence analytics discovery session. Thanks ... Pete

------------------------------
Peter Hacker
------------------------------
9 REPLIES 9

david.l.morris
Level 14
Could you explain exactly what you tried with Send Keys?

It really depends on how the app is designed, but whatever you can do manually to make it work should be what to try. I'm sure you have already tried this, but I just want to be sure. The order of operations to perform would be like this:

  1. Activate Application (action in Navigate stage) on the entire browser window using Win32 Element
  2. Click into the field using a Global Mouse Click action in a Navigate stage on an AA attribute (or anything that lets you global mouse click)
  3. In a Navigate stage, Use Global Send Keys to send the password to the root node in application modeller
  4. And if necessary (depends on the app), send a TAB key
  5. Then Click Sign In
Is that one of the methods you tried?

Edit: FYI I'm not suggesting the above is the only way to do this. I'm just suggesting a specific way based on what you described. Normally I'd try Write stage > Focus > TAB > Click sign in but it sounds like that didn't work for you.

------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company

TomCirone
Level 6
If global send keys really doesn't work, then you can try the javascript.  You need to explore the DOM and javascript to figure out what the field requires.  Some of them use Onclick, onchange, onkeystroke, etc.  You also need to determine which field that's in.  For instance it could be a keystroke on the username or password, on click on the screen, onchange of username, etc.

This is code to trigger an "onchange" for a whole document

"document.body.trigger('change')"

It could also be that you could change an HTML or CSS attribute.  Here's an example where we change the display attribute

"document.getElementById('frm_element_11082039').style.display = 'block'"

The code for javascript is quite easy once you know exactly what the javascript requires.  Finding that can take hours though, and no one would be able to help unless they have access to the web app.



------------------------------
Tom Cirone
Application Developer
Essity
America/New_York
------------------------------

​Thanks Dave Morris

I tried your 5-step sequence with no luck. Some points, I couldn't get a Global Mouse Click on the password field. Browser spy mode only provides Click and UIA always raised the "query item" error. Also, the Enter Password Stage did not load any characters.

the I'm going to see if Region mode is an option, but I've found it unreliable in the past. I've attached a document that shows the Object Page and the details for all Stages.

I really appreciate you taking the time to help.

Cheers...Pete

------------------------------
Peter Hacker
------------------------------

Walter.Koller
Level 11
We have a similar login-screen we had to automate.
An older version of the screen also showed a check box. Checking & unchecking the box had the page recognizing / accepting the password and enabled the sign-in button.
I cannot see something like a check box in your screen but typing the password and pressing the show icon might do the trick (this is now wild guessing)

The newer version of this screen didn't have the check box anymore and we had to investigate again.
This time we managed with Navigate stage Global Send Keys of the password (spied as Edit Box (UIA)).
We are using IE as browser.

------------------------------
Walter Koller
Solution Manager
Erste Group IT International GmbH
Europe/Vienna
------------------------------

​Walter Koller - Hallo,

Thanks for the input. My issue is that I need to send a keystroke to the Password field. Write stage loads the password, but the java script does not recognize the input as keystrokes. I've tried Global Send Keys with no luck. Also spying in UIA mode always results in the dreaded "query terms" error on execution. I am using chrome. incorta does not recommend IE. I'm going to try Region mode today and see if that works.

Thanks...Pete

------------------------------
Peter Hacker
------------------------------

Are you saying you cannot find a way to try Global Send Keys or you successfully attempted it and the characters went into the blank but it still wasn't recognized by the app?

Also, I may be overlooking someone already suggesting this or you may have tried it, but have you attempted setting to the password to the clipboard and then pasting into the blank? That's at least something you should be able to test manually. If you can paste a password manually then there's no reason it wouldn't work in an automated way too.

------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company

​Hi Dave,

Actually I did solve the issue using a modified version of your steps!! So Thanks very much. I'll provide more details and the stage breakdown later so that others can benefit. I have an early appointment, so I can't do it now.

Pete

------------------------------
Peter Hacker
------------------------------

​Hi Dave,

Cut/Paste is an option I didn't think of. I was trying to stay in the notion that passwords would still be masked, since I pass the password as a parameter to the Start Stage. IN any case, I've attached a doc with screenshots that explains the solution. It was based on your feedback, so, thanks very much.

Pete

------------------------------
Peter Hacker
------------------------------

Awesome, I'm glad you got it working!

------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company