18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

How to print variable value and pattern match it.

edited November -1 in Sahi - Open Source
Hi,

I created an routine by which i can send command to remote computer and get the data.

Now i want to print the data recieved, so that i can pattern match and then extract whatever data is needed.

For ex : i do send command "ls" and then i can print what i received.

Later i can pattern match and extract names of files so be used further.

I have code like :

$command = "df -h";
$Result = _executeSSH($command, $hostName, "root", "kazeon");

So this executessh will send the command to remote computer and collect the data received in var Result.

Can someone help me with this.

Bhavesh

Comments

  • TheeranTheeran Members
    edited November 2011
    Hi bhavesh.sharma26,

    There exist only _execute API and to make _execute to return a string,set the second parameter of the _execute API,isSynchronous to true.

    For eg:
    var $value=_execute($command,true,$timeout);
    _alert($value);

    This would popup with a data returned.

    let us know if the problem persists.

    Regards
    Theeran.
Sign In or Register to comment.