Re: Testing WodSSH prompt - WeOnlyDo Discussion board

Re: Testing WodSSH prompt (General questions)

by wodDamir, Tuesday, October 27, 2009, 18:30 (5505 days ago) @ Tamir

Tamir,

If I understood you correctly, you're actually trying to test if user provided the correct prompt for their server.

In that case, you can use your code. However, I would suggest small changes. I.e: you can remove the Execute call.

This should be sufficient:

[php]ssh1.Connect
Dim ret as String
ret = ssh1.WaitFor(your_prompt, 10) [/php]

What above code does, is return everything received by the component before the specified prompt arrives. If it doesn't arrive, a Timeout exception will be thrown on WaitFor call, which means that the Prompt isn't correct.

Hope this helps.

Regards,
Damba


Complete thread: