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 WPF apps in leanft in Java
Below example illustrates how to automate WPF application using LeanFT. Note that we need to import classes from below package.
com.hp.lft.sdk.wpf
In below example, we are first identifying the WPF window with title – Bus Application. After that we have identified the ComboBox with name sourceCity and finally we have listed down all the options in sourceCity ComboBox.
package leanft;
import com.hp.lft.sdk.Desktop;
import com.hp.lft.sdk.wpf.ComboBox;
import com.hp.lft.sdk.wpf.ComboBoxDescription;
import com.hp.lft.sdk.wpf.Window;
import com.hp.lft.sdk.wpf.WindowDescription;
import org.junit.Test;
/**
* Created by Sagar on 20-07-2016.
*/
public class WpfTest extends BaseTest {
@Test
public void test1() throws Exception{
Window win = Desktop.describe(Window.class, new WindowDescription.Builder()
.objectName("Bus Application").fullType("window").windowTitleRegExp("Bus Application").build());
ComboBox box= win.describe(ComboBox.class, new ComboBoxDescription.Builder()
.objectName("sourceCity").build());
for (String s :box.getItems() ) {
System.out.println(s);
}
}
}
Web development and Automation testing
solutions delivered!!