UFT Developer Java SDK code samples

This section includes:

Launch AUT code samples (Java SDK)Launch a desktop application using different parameter combinations.
ImageUtils code samples (Java SDK)
  • Verify that an image exists
  • Verify that an image matches a test object image
  • Search for an image inside another image
  • Compare two images
Insight code sample (Java SDK)Identify and click a button using Insight
Java code samples (Java SDK)
  • Access and select menu items
  • Wait for the AUT to reach a certain state and then click a link
UFT Developer Grid code samples (Java SDK)
  • Lock a node as part of the launch browser step
  • Lock a node and then launch a browser on that node
  • Lock a node and perform operations on a desktop application
  • Lock a node and perform operations using the node's mouse
Mobile code samples (Java SDK)
  • 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 UFT Mobile

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

  • Collect accumulated device vitals data
  • Camera simulation

  • Simulate fingerprint authentication

  • Simulate barcode or QR code authentication
  • Service Virtualization integration

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

  • Run multiple classes or methods in parallel
  • Run data provider tests in parallel
Oracle code samples (Java SDK)
  • Select an item from a ListOfValues
  • Set the value of a cell in a table
PowerBuilder code samples (Java SDK)
  • Select a Tab from a TabControl
  • Set an item in a combo box
Report code samples (Java SDK)
  • 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 (Java SDK)
  • 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 (Java SDK)
  • Select an item from a list and verify the correct selection
  • Delete an item from a list box
Standard Windows code samples (Java SDK)
  • 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 (Java SDK)
  • Wait for text in the emulator screen
  • Send a TE Key on the screen
TestNG code samples (Java SDK)
  • Simple TestNG test
Web code samples (Java SDK)
  • 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 UFT Developer context
  • Use Verify to validate a successful log in
  • Identify an object by its XPath
  • Verify a suggestion box via its CSS identifier
  • Retrieve list items and print them
  • Retrieve and validate list values
  • Validate values in a table
  • Verify that a suggestion box contains at least one suggestion
  • Identify an object using Visual Relation Identifiers (VRI)
  • Verify objects using HTML attributes
  • Use JavaScript to verify that the spell check functionality is enabled
  • Find an element by using regular expressions

  • Wait for a button to exist and be enabled
WPF code sample (Java SDK)Change a toggle button state
ALM/BPT integration code samples (Java SDK)
  • TestNG test for ALM UFT Developer test
  • TestNG test for BPT test
Verification code samples (Java SDK)
  • Basic verification example
  • Custom verification example

See also: