Ask a Question

How to wait on Command prompt till specific wText appeared

ext-kadams
New Contributor

How to wait on Command prompt till specific wText appeared

Is there any way to wait on command line window till the specific text is appeared in wText of Command prompt.

I have used below mentioned code, but it is not working:

var timeoutMinutes = 5
var loopDelay = 5000
var loopCount = 0
var loopCountMax = timeoutMinutes * 60 * 1000 / loopDelay // Timeout 5 Minutes
while(name == "Closing Projects..." )
{
var window = Aliases.cmd.wndConsoleWindowClass2;
var txt = window.wText;
aqString.ListSeparator = "\r\n";
s = aqString.GetListItem(txt, loopCount)
Log.Message(s);
if(s == "Closing Projects...")
break
loopCount++
rowcount = aqString.GetListLength(txt);
Log.Message(rowcount)
Log.Message(loopCount)
}

 

2 REPLIES 2
Kitt
Regular Contributor

What kind of error are you getting and have you checked the Smartbear [reference]?

[[ kITt: keep IT testing ]]

The loop is not waiting till the text "Closing Projects" is appearing on Command prompt.

I have also checked it on Smartbear [reference] but not found any solution.

cancel
Showing results for 
Search instead for 
Did you mean: