Question

I have a JNLP file (say Test.jnlp). I have opened that file using AutoIt. My code for opening Test.jnlp file:

$d = "D:\Ripon\"
$f = "Test.jnlp"
Run("cmd /c " & " """ & $d & $f & """ ", "", @SW_HIDE)

After opening .jnlp file a Login screen comes. My requirement is to type Username and Password -> Click Login button.
As I couldn't find the identity of elements (text fields, button) I failed to do that. Please help me.

enter image description here

Was it helpful?

Solution

There are a few types of GUI that don't give you ids for controls, almost all Java toolkits are an example of that.

There are several methods of automating them still:

  1. Assuming the window is always the same size (which is often a pretty safe assumption to make) then AutoIt will allow you to click the window at a given position, or send text just to that window. For example in the above case you could try the following code:

    ControlSend("Window Title", "", "", "MyUsername{TAB}MyPassword{ENTER}")

  2. Another solution is using accessibility features. If you google 'autoit java accessibility bridge' I'm sure you'll get some results like this one. I've never tried this personally.

  3. There is also a java access bridge no idea how this works either, but other people have been using it for a while.

As a last resort, you have to mimic user mouse and keyboard actions. This really isn't the best solution but at least you can be very sure it will work.

OTHER TIPS

The following snippet of code should work:

Send("username")
Send("{TAB}")
Send("password")
Send("{ENTER}")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top