LeanFT Java code samples (in Java)

This section includes:

Launch AUT code samples (Java) Launch a desktop application using different parameter combinations.
Insight code sample (in Java) Identify and click a button using Insight
Java code samples (in Java)
  • Access and select menu items
  • Wait for the AUT to reach a certain state and then click a link
Mobile code samples (in Java)
  • Tap a button on an AUT and verify that the required string is displayed in an edit field
  • Open Google in a WebView and perform a search
  • Iterate through devices connected to Mobile Center

  • Lock and automatically unlock a device at the end of a session

  • Get device vitals
NativeObject code examples (in Java)
  • Basic usage of NativeObject on a Web application
  • Use native object index to get or modify values from a JavaScript array
OCR code samples (in Java)
  • Get text on a web page using the GetVisibleText method
  • Get a text location on a web page using the GetTextLocations method
Parallel testing code samples (in Java)
  • Run multiple invocations of the same test method in parallel

  • Run multiple classes or methods in parallel
  • Run data provider tests in parallel
PowerBuilder code samples (in Java)
  • Select a Tab from a TabControl
  • Set an item in a combo box
Report code samples (in Java)
  • Customize the run report configuration settings
  • Report a test failure to the run results report
  • Access current report status during runtime
SAP GUI code samples (in Java)
  • Use GuiSession and GuiSessionFactory to launch an SAP GUI session instance and run transactions
  • Use OKCode and Window objects to run a transaction
  • Activate an item in a tree node, navigate to a table object, and set data for a table cell
  • Field to set a value for a SAP GUI edit box
  • Navigate to a combo box and make a selection
SAPUI5 code samples (in Java)
  • Select an item from a list and verify the correct selection
  • Delete an item from a list box
Standard Windows code samples (in Java)
  • Use standard Windows objects to select the font type in a combo box
  • Use visual relation identifiers (VRI) to locate and click a button in the standard Windows calculator
Terminal Emulator code samples (in Java)
  • Wait for text in the emulator screen
  • Send a TE Key on the screen
TestNG code samples (in Java)
  • Simple TestNG test
Web code samples (in Java)
  • Send keystrokes and keystroke combinations to the AUT

  • Use a Verify command to verify navigation to a web site
  • Acquire a browser tab or window that was opened outside of the LeanFT context
  • Validate the status of edit fields for logon credentials after inserting the credentials at least once
  • Use a label's XPath to locate it and verify that the text represents the current date
  • Verify a suggestion box via its CSS identifier
  • Retrieve a list from a combo box, sort the results, and compare the two lists
  • Validate values in a table
  • Verify that a suggestion box contains at least one suggestion
  • Verify edit field values using visual relation identifiers instead of identification properties
  • Verify that all images in the AUT's main page contain the ALT attribute
  • Use JavaScript to verify that the spell check functionality is enabled
  • Open a browser page using the browser's controls
WPF code sample (in Java) Change a toggle button state
ALM/BPT integration code samples (in Java)
  • TestNG test for ALM LeanFT test
  • TestNG test for BPT test
Verification code samples (in Java)
  • Basic verification example
  • Custom verification example

See also: