Create a testing project in Android Studio
In Android Studio, you can create a UFT Developer module using the installed templates. The UFT Developer module template is based on JUnit, but includes enhancements to help you create mobile tests easily.
Create a UFT Developer module
- If you are working with a Maven repository, follow the instructions in Prerequisites for Maven-based projects.
- Open the project to which you want to add the UFT Developer module.
- In Android Studio, click File > New > New UFT Developer Module.
-
On the Create New UFT Developer Module dialog box, enter the Module name and the Java package name, and then click Finish.
A UFT Developer module is created with all the required resources.
- If you are working with a Maven repository, open the module's build.gradle file, and follow the instructions in the file.
- If you are working with OpenText Functional Testing for Developers from your file system and not with a Maven repository and you want to use the OpenText Functional Testing for Developers JavaDoc, you need to add it manually from the Library Properties of the UFT Developer SDK JAR.
Android Studio template content
The UFT Developer module template for Android Studio includes the following:
-
A UFTDeveloperTest.java template where you write your tests.
The template includes setup code, tear-down code, and a single
@Test
annotation containing an emptytest()
method.Rename this method to whatever you want to call your test. You can add multiple
@Test
annotations if you want to include several tests in your class. Each@Test
annotation should declare a void test method that contains the main code for that test. -
The resources\leanft.properties file, which enables you to customize some test settings. For details, see Customize test settings.
-
UnitTestClassBase, which controls what happens during the different phases of your run, including running and closing the runtime engine.
-
References to the com.hp.lft.sdk, com.hp.lft.verifications, and com.hp.lft.sdk.mobile libraries.
- build.gradle scripts.
Next steps: