Use your own frameworks
When you create your tests using the UFT Developer project templates provided with the IDE plugin, your projects are created with everything you need to use the SDK, communicate with the runtime engine, and generate HTML run reports.
You can also work with OpenText Functional Testing for Developers using your own frameworks. You can build on top of the UFT Developer project templates or create everything from scratch.
Initialize the SDK
-
Reference the SDK files:
Visual Studio Add references to the DLLs located in: <Installdir>\SDK\DotNet Eclipse, Spring Tool Suite, JBoss Developer Studio, or IntelliJ IDEA Add the jar files (except the javadoc.jar) from: <Installdir>\SDK\Java to your build path
-
Use SDK.Init to initialize the SDK:
SDK.Init applies the required test settings and enables communication with the runtime engine.
You must initialize the SDK once, at the beginning of each run.
If you want to use default values for the SDK, you need only the following line to initialize the SDK:
SDK.Init(new ModifiableSDKConfiguration());
-
Optional. To generate the HTML report:
-
Initialize the report by running Reporter.Init after SDK.Init at the beginning of each run.
-
Use the relevant ReportConfiguration and Reporter properties and methods to control the way the report is generated. Make sure to use Reporter.GenerateReport as shown in the examples below, to ensure the report gets generated. For details, see the relevant SDK reference.
-
Initialize the SDK and report - Code samples
The samples below demonstrate how to initialize both the SDK and Report, and to modify one of the SDK default values:
public void Test() { //Initialize the SDK and report once per process
//Modify the default value for the SdkConfiguration ServerAddress
//Initialize the Reporter with default values SDK.Init(new SdkConfiguration { ServerAddress = new Uri("ws://myServerAddress:5095") }); Reporter.Init(new ReportConfiguration() { TargetDirectory = "C:\Results\" }); //Put your test code here
//Generate the report and cleanup the SDK usage
Reporter.GenerateReport();
SDK.Cleanup();
}
public static void main(String [] args){
// initialize the SDK and report only once per process
try{
ModifiableSDKConfiguration config = new ModifiableSDKConfiguration();
config.setServerAddress(new URI("ws://myServerAddress:5095"));
SDK.init(config);
Reporter.init();
//put your test code here.
//Generate the report and cleanup the SDK usage.
Reporter.generateReport();
SDK.cleanup();
}
catch(Exception e){
}
See also: