Cannot access Browser Login prompt/dialog

OK i have done that but it brings be back to the same issue. I am at the sign-in page. To summarize what the test case is expected to do is the following.
a) It gets an activation code from a web page,
b) opens a new tab and navigates to the camera web page where this activation code will be used.
c) Need to sign-in to this activation web page.
d) The function takes username/password as parameters,

eg: lets say the username is “admin”.

How do i know what keys to press using the robot? What are the command lines I need to use for this?
robot.keyPress(KeyEvent.XXXX);

What is XXXX in this case? Is that even possible to achieve?
Thanks

I’ve never used Robot to do this. This is a browser-level notification, so aside from passing the credentials in the URL, you may try and handling it with desired capabilities:

@Brandon_Hein

Thanks for stepping up, Brandon.

@mgrandillo I was hoping your Robot code (with keypresses for “admin” etc) would just work after the login panel appears. Hopefully, the panel places the focus in the Username field - right? Then using Robot, you can TAB to the password field and issue the keypresses for the password. Then, finally, issue an ENTER keypress.

That said, and since the auth seems to be indicating plain-text, I fancy Brandon’s original idea (credentials in the URL) has a good chance of working. Try it. It’s the easiest approach, by far - then you can ditch all that Robot stuff.

I find a very easy solution thanks to Brandon.

WebUI.authenticate(URL, ‘admin’, ‘Password’, 12)

That will sign in and the rest is trivial. Thanks again Brandon for the idea :slight_smile:

2 Likes

2 posts were split to a new topic: Can’t get value from field

yes, just got lazy lol, thank you sir!!!

I had a similar issue, but it’s resolved now with your approach . Thank you for the solution.