Introduction

This page shows some useful configuration options when the UI Engine is used for testing HTML/Javascript applications

 


Basic configuration

Using the UiEngineConfigurator class you can do some changes to the UI Engine behavior.

Following are some examples, look at the available setter methods for all options.

 

import com.axway.ats.uiengine.configuration.UiEngineConfigurator;

UiEngineConfigurator configurator = UiEngineConfigurator.getInstance();

// by default we will not allow access to invisible UI elements
configurator.setWorkWithInvisibleElements( true );

// Highlight the element we work with - good for debugging purpose
configurator.setHighlightElements( true );

// set some sleep time between element interactions - good for debugging purpose
configurator.setCommandDelay( 2000 );

// path to a folder where the browser will save downloaded files
configurator.setBrowserDownloadDir( DIR_PATH );

 


PhantomJS configuration

Following are options applicable PhantomJS driver only

Page settings

You can modify any of the supported by PhantomJS page settings, which are described here.

// Single settings format:
// System.setProperty( PhantomJSDriver.SETTINGS_PROPERTY, "settingName: value" );
// Multiple settings format:
// System.setProperty( PhantomJSDriver.SETTINGS_PROPERTY, "{settingName: value}, {other setting: value 2}" );

// Example
System.setProperty( PhantomJSDriver.SETTINGS_PROPERTY, "userAgent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0" );

Custom headers

// Single settings format:
// System.setProperty( PhantomJSDriver.CUSTOM_HEADERS_PROPERTY, "header name: value" );</b>
// Multiple headers format:
// System.setProperty( PhantomJSDriver.CUSTOM_HEADERS_PROPERTY, "{header X: value X}, {header Y: value Y}" );

// Example
System.setProperty( PhantomJSDriver.CUSTOM_HEADERS_PROPERTY, "Accept-Language: en-US,en;q=0.5" );

Specific SSL Protocol for the connection handshake

// possible options are SSLv3, SSLv2, TLSv1, any (default)
System.setProperty( PhantomJSDriver.SSL_PROTOCOL_PROPERTY, "TLSv1" );

 


Back to parent page

Go to Table of Contents