LeanFT Java code samples

This section includes:

Insight code sample Identify and click a button using Insight
Java code samples
  • Access and select menu items
  • Wait for the AUT to reach a certain state and then click a link
Mobile code samples
  • 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

NativeObject code examples
  • Basic usage of NativeObject on a Web application
  • Use native object index to get or modify values from a JavaScript array
OCR code samples (Windows only)
  • 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
  • Run multiple invocations of the same test method in parallel

  • Run multiple classes or methods in parallel
  • Run data provider tests in parallel
Report code samples
  • 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
  • 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
  • Select an item from a list and verify the correct selection
  • Delete an item from a list box
Standard Windows code samples
  • 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
  • Wait for text in the emulator screen
  • Send a TE Key on the screen
TestNG code samples
  • Simple TestNG test
Web code samples
  • Send keystrokes and keystroke combinations to the AUT

  • Use an Assert 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 Change a toggle button state
ALM/BPT integration code samples
  • TestNG test for ALM LeanFT test
  • TestNG test for BPT test

See also: