WindowsCredentials Object

Applies to TestComplete 15.64, last modified on May 16, 2024
Testing web services with TestComplete is obsolete. We recommend that you use ReadyAPI, another SmartBear's automated testing tool for SOAP and REST web services.
If needed, you can run ReadyAPI tests from TestComplete.

Description

The WindowsCredentials object provides a program interface to Windows credentials for the web service that will be tested with the Web Service project element.

You obtain the WindowsCredentials object in scripts through the Windows property of the WebServiceCredentials object.

The WindowsCredentials object provides a scripting interface to the tested web service’s Windows credentials. It contains two properties that help you configure the Windows credential object that the client uses to authenticate itself to the service.

Members

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

Windows Property
About Testing Web Services
About Testing Web Services
About Web Service Checkpoints

Highlight search results