Object Model Reference for GUI Testing > Utility Objects > AddCookie Method

WebUtil Object

Description

Enables you to set or modify Web related settings.

Associated Methods

Method AddCookie Adds a cookie to the test transaction file.
AttachRemoteDebugging Enables UFT to access an application containing Java Chromium Embedded controls through a specific address and port during a run session.
Method DeleteCookie Deletes a cookie from the cookie table.
DeleteCookies Deletes all cookies for the browser being used in the test run.
DetachRemoteDebugging Stops the connection to an application containing Java Chromium Embedded controls during a run session.
GetCookies Retrieves the list of cookies for the browser being used in the test transaction file run.
LaunchBrowser Launches a browser for a business process test (BPT) based on the specific parameters.
LaunchMobileBrowserWithID Launches a browser for a business process test (BPT) using the id.

Back to top

AddCookie Method

Description

Adds a cookie to the test transaction file.

IMPORTANT

This method is supported for Internet Explorer browsers only.

Syntax

WebUtil.AddCookiedomain, cookies

Argument

Type

Description

domain

String

The name of the domain that the host uses.

cookies

String

The cookie information in the format:

NAME=VALUE; expires=DATE;path=PATH; domain=DOMAIN_NAME; secure.


Back to top

AttachRemoteDebugging Method

Description

Enables UFT to access an application containing Java Chromium Embedded controls through a specific address and port during a run session.

Syntax

WebUtil.AttachRemoteDebugging URL:port

Argument

Type

Description

URL:port

String

The address of the application and the port number used to access it.


Back to top

DeleteCookie Method

Description

Deletes a cookie from the cookie table.

IMPORTANT

This method is supported for Internet Explorer browsers only.

Syntax

WebUtil.DeleteCookiedomain, cookies

Argument

Type

Description

domain

String

Name of the domain that the host uses.

cookies

String

The cookie information in the format:

NAME=VALUE; expires=DATE;path=PATH; domain=DOMAIN_NAME; secure.


Back to top

DeleteCookies Method

Description

Deletes all cookies for the browser being used in the test run.

IMPORTANT

This method is supported for Internet Explorer browsers only.

Syntax

WebUtil.DeleteCookies


Back to top

DetachRemoteDebugging Method

Description

Stops the connection to an application containing Java Chromium Embedded controls during a run session.

Syntax

WebUtil.DetachRemoteDebugging URL:port

Argument

Type

Description

URL:port

String

The address of the application and the port number used to access it.


Back to top

GetCookies Method

Description

Retrieves the list of cookies for the browser being used in the test transaction file run.

IMPORTANT

This method is supported for Internet Explorer browsers only.

Syntax

WebUtil.GetCookieURL

Argument

Type

Description

URL

String

The URL of the site from which to return the cookies.

This URL must contain http:// to return the cookies for the selected site.

Return Value

A list of all cookies for the site


Back to top

LaunchBrowser Method

Description

Launches a browser for a business process test (BPT) based on the specific parameters.

Syntax

WebUtil.LaunchBrowserBrowser, [device_model, device_manufacturer, device_ostype, device_osversion]

Argument

Type

Description

Browser

String

Required. The name of the browser to launch.

Possible values:

  • IE

  • IE64
  • CHROME
  • FIREFOX
  • FIREFOX64
  • FF<VersionNumber>
  • SAFARI
  • EDGE
  • PHANTOMJS
  • CHROME_EMULATOR
  • MOBILE_HPWEB
  • MOBILE_CHROME

  • MOBILE_SAFARI

device_model String

Optional. The model of the selected device containing the browser.

This parameter should not be used when launching browsers on a desktop.

Device names must be identical to those listed in the Device section in the Mobile Center Wizard.

device_manufacturer String

Optional. The manufacturer of the specific device.

This parameter should not be used when launching browsers on a desktop.

device_ostype String

Optional. The operating system running on the specified device.

This parameter should not be used when launching browsers on a desktop.

One of the following:

  • ANDROID
  • IOS

Mandatory if the Browser value is set to MOBILE_HPWEB.

device_osversion String

Optional. The operating system version running on the specified device.

This parameter should not be used when launching browsers on a desktop.

Return Value

None


Back to top

LaunchMobileBrowserWithID Method

Description

Launches a browser for a business process test (BPT) using the id.

Syntax

WebUtil.LaunchMobileBrowserWithIDBrowser, device_ostype, device_id

Argument

Type

Description

Browser

String

Required. The name of the browser to launch.

Possible values:

  • MOBILE_HPWEB

  • MOBILE_CHROME

  • MOBILE_SAFARI

device_ostype String

Required. The operating system running on the specified device.

One of the following:

  • ANDROID
  • IOS
device_id String

Required. The id property assigned to the device by Mobile Center.

Return Value

None

Back to top

See also: