Integrate with BPT
If you are working with BPT, you can add business components to flows and business process tests.
For details on creating flows and business process tests, see the ALM Help Center.
Note: OpenText Functional Testing for Developers business components cannot be mixed with other types of business components in flows and business process tests.
Include business components in business process tests
After you have written your OpenText Functional Testing for Developers test, you can set up a corresponding business process test in OpenText Application Quality Management containing your test methods by creating business components in OpenText Application Quality Management's Business Components module and using them in a business process test
You can create a business component manually for each test method, or you can use the import tool to create multiple business components simultaneously. Importing is recommended if you want to migrate a large number of test methods to OpenText Application Quality Management.
Manually create business components
When defining business components manually:
-
In OpenText Application Quality Management, create a new business component, or select an existing one.
-
Add automation:
Note: Each OpenText Functional Testing for Developers business component represents a single test method inside a test class.
In the Automation tab, click Add Automation, and select LeanFT automation subtype.
-
In the Automation tab, define your business component. Provide values for the required fields as follows:
Field Value to enter Framework
Select the framework you are using.
JAR/DLL Path
The path of the .dll or .jar file containing your test, depending on the framework. You can specify either a full file path or a relative path.
Fully Qualified Class Name
The fully qualified name of your class, including the namespace (NUnit/MSTest) or package (JUnit/TestNG).
Test Method Name
The name of the test method that your business component will run.
Import OpenText Functional Testing for Developers test methods into business components in OpenText Application Quality Management
The export/import procedure is identical for business components as for LEANFT-TEST tests.
-
In OpenText Functional Testing for Developers:
-
In your test project, compile the DLL or export the JAR.
-
Run the export tool command line utility relevant to your testing framework, as described in Exporting test methods.
-
-
In OpenText Application Quality Management:
-
In the Business Components module, select Components > Import UFT Developer Components.
-
Select the XML file generated by the export tool, and click Open.
-
Select the test methods to import to business components, and click Import.
A new business component is created for each selected test method, with all required fields defined.
-
Data driving business components
Just as in any test, you can expand the scope of your business components by creating content using defined input values. In addition, for business components, you can define output parameters as well.
Input parameters
Define input values the same way as you would for tests. For details, see Data-drive your ALM tests.
Output parameters
Define output parameters for business components according to your framework. You can define parameters for NUnit, MSTest, TestNG, or JUnit.
NUnit
Add a new OutputParameters attribute with the names of your output parameters just below the TestCaseSource attribute using the following format:
[OutputParameters("Out1", "Out2", .... , "OutX")]
For example:
public string Out_BookIsbn; [TestCaseSource("ALM")] [OutputParameters("Out_BookIsbn")] public void SearchBook(string bookTitle, string bookAuthor) { bookTitleEditField.SetValue(bookTitle); bookAuthorEditField.SetValue(bookAuthor); searchBtn.Click(); Out_BookISBN = bookIsbnEditField.Value; }
MSTest
Use the [OutputParameters( parameter_names )] attribute to mark the class variable as an output parameter for the business component.
Note: Because of MSTest’s test structure, the class variables that are mapped to output parameters should be static.
For example:
public static string Out_BookIsbn; [TestMethod] [DataSource("ALM")] [Parameters("Title", "Author")] [OutputParameters("Out_BookIsbn")] public void SearchBook() { var title = Convert.ToString(TestContext.DataRow["Title"]); var author = Convert.ToString(TestContext.DataRow["Author"]); bookTitleEditField.SetValue(title); bookAuthorEditField.SetValue(author); searchBtn.Click(); Out_BookISBN = bookIsbnEditField.Value; }
TestNG
Add the @OutputParameters({ parameter_name_list}) annotation to your test method to mark the class variable as an output parameter for the business component.
public String Out_BookIsbn; public String Out_BookPrice; @Test(dataProvider="ALM") @Parameters({"Title", "Author"}) @OutputParameters({"Out_BookIsbn", "Out_BookPrice"}) public void test(String title, String author) throws Exception { bookTitleEditField.setValue(title); bookAuthorEditField.setValue(author); searchBtn.click(); Out_BookISBN = bookIsbnEditField.getValue(); }
JUnit
Add the @OutputParameters({<output_parameter_name_list > }) annotation with the names of your output parameters to your test method. For example:
@Parameter(0) public String Title; @Parameter(1) public String Author; public String Out_BookIsbn; public String Out_BookPrice; @Test @OutputParameters({"Out_BookIsbn", "Out_BookPrice"}) public void test() throws Exception { bookTitleEditField.setValue(Title); bookAuthorEditField.setValue(Author); searchBtn.click(); Out_BookISBN = bookIsbnEditField.getValue(); }
Next steps: