jus4kikz avatar image
jus4kikz asked jus4kikz posted

iTest SDK "hello world" example...


My question about the iTest SDK ... is basically can some one show/post/link me to a "hello world" example ... no gui... just an example of an instantiation of a simple session object to connect to a router via telnet / ssh ... send a "show version" ... or a "ls -latr" to an ssh session on a linux box... and print the response in a system.out?


Maybe something like this:



Import <some.fanfare.class.objects....>


public class HelloWorld {


    public static void main(String[] args) {


        //initiatoin of objects...




        //connect to the iTest device via the SDK APIs...


        //Send a command to the Device

        String response = iTestSessionObject.sendCommmand("Show Version");

        System.out.println("Output From the Session Profile receiving the command=" + response);





Thanks in advance for the help

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

AdamB avatar image
AdamB answered AdamB posted

The iTest SDK is mainly for creating tools and monitoring Reporting and Execution.  We don't have a way to write a script via the SDK, you'd have to use iTest to do the steps you're talking about.


We are very interested in these sorts of things going forward and would love to hear how you'd like to have things extendable.  Also, if you look into NTAF, you will see that it will hopefully provide an interfact to work with devices/tools in the manner you're hoping to.



10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jus4kikz avatar image jus4kikz commented ·

:-/ how sad.


I was hoping there was some kind of work flow already in place that could utilize existing test session profiles already set up in iTest ... such that there could be an interface from Java to instantiate, call, and proceed in that fashion.


Maybe this approach isnt as main stream as I thought....


I guess as a work around, I could use iTestRT and invoke anything I need from the command line and have java parse that.



0 Likes 0 ·
AdamB avatar image AdamB jus4kikz commented ·

Well, it isn't something that is out of the question, and there might be some interesting things in the future that would make this easier.

0 Likes 0 ·
jus4kikz avatar image jus4kikz AdamB commented ·

ok, for now I have an example that does this

1.  creates an XML file as an "input" file to read to populate global params
2.  starts iTest via itestRT and reads the xml and does a bunch of gsets on parameters/<params>

3.  spawns the shells requested dynamically (foreach shell_type ... currently just using TELNET issue an open ... and give it the dynamicly passed in SHELL_NAME)
4.  for each <TEST_CASE> defined, excecute the set of <TEST_COMMANDS> with their own "PASS" criteria on simple "contains/regexps" passed in.
5.  return the result (string from teh exec command on calling itestRT will contain "Excecution status: Pass" for example if OK.



I also suppose doing this via iTestRT is better because it can allow us (the test team) to continue to develop and focus on our test environment in iTest, but allows the developers
an alternative way to leverage the sessions created for devcie interaction .



0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.