UFT Pro (LeanFT) and Selenium capabilities

This topic defines the supported capabilities for running tests remotely in UFT Pro (LeanFT) and Selenium.

Define capabilities for browsers

The following examples illustrate how to use capabilities to define the browsers used in your web testing environment.

Tip: If you upload these tests to SRF, the browser definition in the code is ignored. For uploaded tests, select the browser directly in SRF's environment selection dialog box. For more details, see Environment.

UFT Pro (LeanFT)

In LeanFTJava, define your browser capabilities as follows:

BrowserDescription desc = new BrowserDescription ();

desc.set(<capability name>, <capability value>);

Or, use the builder syntax:

BrowserDescription desc = new BrowserDescription.builder().set(<capability name>, <capability value>).build();

In LeanFTC#, define your browser capabilities as follows:

var desc = new BrowserDescription ();

desc.Set(<capability name>, <capability value>);

var browser = SrfLab.LaunchBrowser(desc);

In LeanFTJavaScript, define your browser capabilities as follows:

LFT.SrfLab.launchBrowser({

<capability name>: <capability value>

}).then…;

Selenium

In Selenium Java, define your browser capabilities as follows:

static DesiredCapabilities capabilities = DesiredCapabilities.<browser type>();

 

@BeforeClass

public static void openBrowser() throws MalformedURLException{

capabilities.setVersion(<browser version);

capabilities.setCapability(<capability name>, <capability value>);

In Selenium C#, define your browser capabilities as follows:

DesiredCapabilities dc;

RemoteWebDriver driver;

[OneTimeSetUp]

public void Init()

{

dc = DesiredCapabilities.<browser type>();

dc.SetCapability(<capability name>, <capability value>);

driver = new RemoteWebDriver(new Uri("https://ftaas.saas.hpe.com/wd/hub/"), dc);

In Selenium JavaScript, define your browser capabilities as follows:

var capabilities = {

<capability name>: <capability value>

};

driver = new webdriver

.Builder()

.withCapabilities(capabilities)

.build();

In Selenium Ruby, define your browser capabilities as follows:

caps = Selenium::WebDriver::Remote::Capabilities.chrome(
 :<capability name> => "<capability value>"
)

Back to top

Define capabilities for devices

The following examples illustrate how to use capabilities to define the devices used in your mobile testing environment.

UFT Pro (LeanFT)

In LeanFTJava, define your device capabilities as follows:

DeviceDescription desc = new DeviceDescription ();

desc.set(<capability name>, <capability value>);

Or, use the builder syntax:

DeviceDescription desc = new DeviceDescription .builder().set(<capability name>, <capability value>).build();

In LeanFTC#, define your device capabilities as follows:

var desc = new DeviceDescription();

desc.Set(<capability name>, <capability value>);

var device = SrfLab.LockDevice(desc);

In LeanFTJavaScript, define your device capabilities as follows:

LFT.SrfLab.lockDevice({

<capability name>: <capability value>

}).then…;

Back to top

Browser capability reference

Use the following capabilities to define the browser used to run your test.

osType / osVersion Operating system type and version

UFT Pro (LeanFT) only.

String (case insensitive).

For more details, see the UFT Pro (LeanFT) Product Availability Matrix.

platform Operating system type and version

Selenium only.

String, case insensitive.

One of the following:

  • Windows 7
  • Windows 8.1
  • Windows 10
  • Ubuntu 16.04
resolution

Browser resolution

String with the following syntax: <width>x<height>

Windows:

  • 800x600
  • 1024x768 (default if no value provided)
  • 1280x1024
  • 1366x768
  • 1600x900
  • 1920x1080
type

Browser type

UFT Pro (LeanFT) only

enum: String, with the enum name (BrowserType)

string: Case insensitive, one of the following:

  • Chrome
  • Internet Explorer
  • Firefox
  • Safari
browserName

Browser type

Selenium only

string: Case insensitive, one of the following:

  • Chrome
  • Internet Explorer
  • Firefox
  • Safari
version Browser version

String (case insensitive). A number indicating the browser version, or latest to use the latest available version.

Available versions include:

  • Chrome: last 5 versions, beta, latest to use the latest available version.
  • Firefox: last 5 versions, beta, latest to use the latest available version.
  • Safari: 11.0
  • Internet Explorer: 11

For more details, see the UFT Pro (LeanFT) Product Availability Matrix.

Back to top

Device capability reference

Use the following capabilities to define the device used to run your test.

id Mobile Center device ID String (case insensitive)
manufacturer Device manufacturer String (case insensitive)
model Device model String (case insensitive)
name Mobile Center device name String (case insensitive)

For details about supported devices, see the Mobile Center Help.

Back to top

See also: