Xshell Forum

Screen.WaitForStrings broken in latest Xshell6 build

Last post: Friday, November 9, 2018 9:10 PM by jsanagustin, 6 reply

 
Friday, July 13, 2018 4:00 PM - jsanagustin

Screen.WaitForStrings broken in latest Xshell6 build

 
So I updated Xshell6 today. Once completed, I went on with my day and tried to use one of my scripts that I've been using for months without issue. Today, however, it did not work properly.

I isolated the trouble to a point where I used xsh.Screen.WaitForStrings(waitStrArr, waitTimeout).

waitStrArr is an array of strings to be watched for.
waitTimeout is a number, 10000.

It seems that as soon as anything new is printed in the screen, WaitForStrings returns -1.

The behavior I'm expecting is that WaitForStrings waits for one of the strings in the array. If it finds one of the array elements, it returns the position of that element. In other words, if it finds the 2nd element in the array, it returns 2. However, if it never finds any of the strings in the array, only after the given timeout expires will it return -1

This script works exactly as expected in Xshell5

Don't suppose there's I could download the previous build of Xshell6?

Program Ver. : Xshell 6
Monday, July 16, 2018 3:23 PM - Support

Re: Screen.WaitForStrings broken in latest Xshell6 build

 
We've confirmed this issue and will be releasing a fix asap. Thanks for the report.

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Monday, August 6, 2018 4:28 PM - jsanagustin

Re: Screen.WaitForStrings broken in latest Xshell6 build

 
Hi,

I received an email from support requesting an example, which I provided. Support then replied claiming that they were unable to recreate the issue, to which I replied with examples showing the same script working fine in Xshell5, but failing in Xshell6. I'd also like to reiterate that the the same script was working fine in Xshell6 prior to updating to build 0094.

Could someone confirm if a solution is still being pursued?
Monday, August 6, 2018 4:32 PM - Support

Re: Screen.WaitForStrings broken in latest Xshell6 build

 
Yes, someone has been assigned to your issue. We will provide further correspondence via the email thread. Thanks!

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Monday, August 6, 2018 9:12 PM - jsanagustin

Re: Screen.WaitForStrings broken in latest Xshell6 build

 
Great, thanks!
Thursday, September 6, 2018 5:32 PM - jsanagustin

Re: Screen.WaitForStrings broken in latest Xshell6 build

 
In case anyone else is keeping an eye on this...

I've been emailing with NetSarang support, so much of the activity is not reflected here.

I managed to isolate the cause to my code adding a method to Javascript's Array prototype. Well, my script actually adds two methods, but if either of them are present, Screen.WaitForStrings() doesn't behave correctly. I've even tried changing the names of these methods, but to no avail. I've reported this finding in my email with support, but haven't seen a reply so far.

So if you've experienced the same problem as I have, check to see if your scripts added to the Array prototype.
Friday, November 9, 2018 9:10 PM - jsanagustin

Re: Screen.WaitForStrings broken in latest Xshell6 build

 
FYI, support confirmed that this problem was patched in Xshell 6 build 0101