Trouble filling fields in an CLI based application

12 views
Skip to first unread message

Alex camlay

unread,
Sep 6, 2023, 5:00:55 AM9/6/23
to Yet another Expect for Java
Hi everyone,

First, I would like to express my gratitude for providing us this library.

I am currently attempting to interact with an application through SSH/telnet. The application is an old one in our company, and it has several fields that need to be filled : 
Picture1.png
The cursor is set on the first field by default, and I have to fill in the first field and then press "TAB" to move on to the next one.
Once I have filled in all the fields, I have to press "ENTER" to go to the next page.

I have successfully connected to the application through JSCH and Expectit, and the output is well the same screen as I would have manually :
Picture2.png
However, when I try to fill in the fields, the values are written below instead of in the fields :
Picture3.png

I am unsure of the utility of this command, but I have tried adding the line expect.interact(); without any success.

If anyone has any suggestions, I would greatly appreciate it.

Here is my code : 

image_2023-09-06_105945311.png

Thank you and best regards,
Alexis CAMLAY

Alex camlay

unread,
Sep 6, 2023, 5:08:54 AM9/6/23
to Yet another Expect for Java
Hi, 

I'm sorry I just found the solution, I needed to use interact() and use \r instead of \n to perform the validation.

Best regards,
Alexis CAMLAY

Reply all
Reply to author
Forward
0 new messages