LeanFT with Java
Introduction Supported applications Installation of LeanFT and plugins for IDEs Installing browser Extensions LeanFT settings,Object identification Center Understanding LeanFT SDK API Installing the LeanFT jar files in Maven Repository Creating LeanFT Maven Project Creating LeanFT Project with Gradle and TestNG LeanFT Properties Setting up LeanFT project in IntelliJ IDEA Creating maven project with JUnit with LeanFT in Eclipse Creating maven project with TestNG in Eclipse Description programming Application model Using regular expression in property values First web application test Identifying the Web elements using XPATH and CSS Identifying objects using Visual Relational Identifiers – VRI Handling embedded browser control in Windows app Firing events on Web Elements using LeanFT Executing JavaScript in web page Automating standard windows application Automating Java Application Automating WPF applicationsAutomating SAP Application Synchronization in LeanFT Assertions in LeanFTLeanFT with Cucumber Keyword Driven frameworks Data Driven Frameworks Converting the UFT Object Repository to Application models in LeanFTChallenges of LeanFT automation Working with third party objects using Native Object properties and methods LeanFT common issues and solutionsLeanFT Java ReferencesAutomating Java apps in leanft in Java
Automating the Java applications is just like that of Standard windows applications. Only difference is that you need to import classes in below package. Here is the sample example that identifies the Java window with title – XYZ and then clicks on the check box with attached text as “Gender” inside a frame.
import com.hp.lft.sdk.java.*;
package leanft;
import com.hp.lft.sdk.CheckedState;
import com.hp.lft.sdk.Desktop;
import com.hp.lft.sdk.java.*;
import org.junit.Test;
public class JavaTest extends BaseTest {
@Test
public void test() throws Exception {
Window javaWin = Desktop.describe(Window.class, new WindowDescription.Builder()
.title("XYZ").build());
CheckBox checkBox = javaWin.describe(InternalFrame.class, new InternalFrameDescription.Builder()
.title("Frame1").build()).describe(CheckBox.class, new CheckBoxDescription.Builder()
.attachedText("Gender").build());
checkBox.setState(CheckedState.CHECKED);
}
}
Web development and Automation testing
solutions delivered!!