Xshell Forum

xsh.Screen.WaitForStrings return -1

Last post: Wednesday, May 31, 2017 4:29 PM by Support, 2 reply

 
Thursday, April 27, 2017 8:38 PM - Jankiel Goldman

xsh.Screen.WaitForStrings return -1

 
Hi I have a script thats keeping return -1 (see refer [2])
in this line:
resultuserid = xsh.Screen.WaitForStrings(Array("NEW PASSWORD:", "ERROR", "USER ID ALREADY EXISTS"),500)

So, as troubleshooint I made a smaller (refer [1]) to just test this part and works! Its the same commands! No differs!

https://pastebin.com/qJ2JiaZB The small part that is working[1]
https://pastebin.com/rs3nRLVC The original script not working[2]

Program Ver. : Xshell 5
Tuesday, May 2, 2017 7:02 PM - Support

Re: xsh.Screen.WaitForStrings return -1

 
This issue is being investigated. Hang tight. Thanks!

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Wednesday, May 31, 2017 4:29 PM - Support

Re: xsh.Screen.WaitForStrings return -1

 
I apologize for the delayed response.

We tested your script and it looks like the xsh.Screen.WaitForStrings function works as intended.

To ensure your script is running properly, I recommend the following:

1. Make sure Xshell is up to date. There were problems with WaitForStrings in the past, but these issues have since been fixed.
2. The time out value of WaitForStrings needs to be quite long. I recommend 0 if possible.
3. The sleep time code before WaitForString (not WaitForStrings) is called:
xsh.Session.Sleep(1000)
xsh.Screen.WaitForString "<"

Hope this helps!

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog