ClientCredentials Property

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

Use this property to get or set Windows client credentials (user name, domain and password) used by a user to identify himself in the web service under test.

Declaration

WindowsCredentialsObj.ClientCredentials

Read-Write Property ClientCredentials object
WindowsCredentialsObj An expression, variable or parameter that specifies a reference to a WindowsCredentials object

Applies To

The property is applied to the following object:

Property Value

The ClientCredentials object that assists you in defining the user name, domain and password used for authenticating the client to the tested service by Windows.

Example

The following code defines the Windows credentials for the SampleWebService web service.

JavaScript, JScript

function Test()
{
  var service = WebServices.SampleWebService;

  var auth = service.Credentials.Windows;
  auth.AllowNtlm = true;
  auth.ClientCredentials.UserName = "Tester";
  auth.ClientCredentials.Domain = "QA";
  auth.ClientCredentials.Password = "123456";
}

Python

def Test():
  service = WebServices.SampleWebService;
  auth = service.Credentials.Windows;
  auth.AllowNtlm = True;
  auth.ClientCredentials.UserName = "Tester";
  auth.ClientCredentials.Domain = "QA";
  auth.ClientCredentials.Password = "123456";

VBScript

Sub Test
  Dim service, auth

  Set service = WebServices.SampleWebService

  Set auth = service.Credentials.Windows
  auth.AllowNtlm = True
  auth.ClientCredentials.UserName = "Tester"
  auth.ClientCredentials.Domain = "QA"
  auth.ClientCredentials.Password = "123456"
End Sub

DelphiScript

procedure Test;
var service, auth;
begin
  service := WebServices.SampleWebService;

  auth := service.Credentials.Windows;
  auth.AllowNtlm := true;
  auth.ClientCredentials.UserName := 'Tester';
  auth.ClientCredentials.Domain := 'QA';
  auth.ClientCredentials.Password := '123456';
end;

C++Script, C#Script

function Test()
{
  var service = WebServices["SampleWebService"];

  var auth = service["Credentials"]["Windows"];
  auth["AllowNtlm"] = true;
  auth["ClientCredentials"]["UserName"] = "Tester";
  auth["ClientCredentials"]["Domain"] = "QA";
  auth["ClientCredentials"]["Password"] = "123456";
}

See Also

WindowsCredentials Object
ClientCredentials Object
Testing Web Services

Highlight search results