Cybersecurity
DevOps Cloud (ADM)
IT Operations Cloud
When creating a Test Definition via the SilkCentral Web Services we must know the properties that we must successfully set in order to allow successful creation of the Test Definition. Firstly what we must determine is the "id" of the Third Party test-type itself, this is quite easily achieved:
We can proceed with determining how we can retrieve the property names for a third party test-type. This article will assume that you as the developer were able to successfully create the code which logs you in as a user and obtain a session id. What we must now do is obtain an instance of our planning service:
try{
TmplanningSoapBindingStub plnBind = (TmplanningSoapBindingStub) new PlanningServiceServiceLocator().gettmplanning();
.....
}
catch(Exception e) {
e.printStackTrace();
}
Now that we have obtained an instance of our planning service we can now expand the above code and retrieve the required property names using the "getPropertyIds" method.
try{
TmplanningSoapBindingStub plnBind = (TmplanningSoapBindingStub) new PlanningServiceServiceLocator().gettmplanning();
//replace idValue with the value of the id attribute that was noted previsouly
String [] propertyNames = plnBind.getPropertyIds(sessionID, "ThirdParty", "_idValue_");
}
catch(Exception e) {
e.printStackTrace();
}
In the above code excerpt the property names required for creating a third party test-type Test Definition are now stored in the String array propertyNames with the format, "_idValue_PropertyName". Let us look at a worked example using the Telnet third party test-type, in which our code would look like the following:
try{
TmplanningSoapBindingStub plnBind = (TmplanningSoapBindingStub) new PlanningServiceServiceLocator().gettmplanning();
String [] propertyNames = plnBind.getPropertyIds(sessionID, "ThirdParty", "_telnetTest_");
for(int i=0;i<>
System.out.println(propertyNames) ;
}
}
catch(Exception e) {
e.printStackTrace();
}
If the above code was executed the following property names would be printed to the console:
_telnetTest_Break
_telnetTest_Username
_telnetTest_Password
_telnetTest_Port
_telnetTest_Prompt
_telnetTest_Hostname
_telnetTest_Command