Forum Discussion

petercsanyi's avatar
petercsanyi
Occasional Contributor
5 years ago
Solved

"JScript runtime error" at Webservice ClientCertificate object

I use the QAComplete's psWS Webservices in my Project with HTTPS protocol. 

My Code:

 

function _Test_Ws()
{
  var tmp = Ws_GetVersion();
  //var tmp = Ws_GetLoginInfo(wsObj);
  
  return true;
}

function ServiceCertificate()
{
  var service, crd, certificate;

  service = WebServices.QAComplete;
  crd = service.Credentials;
  certificate = crd.ClientCertificate;
  certificate.SetCertificateEx(slLocalMachine, snMy, ftFindBySerialNumber, "6b46030c65549b4c83d07690102358f0e315eead");

}

function Ws_GetVersion()
{
  // Ws_GetVersion() - QAComplete GetVersion WebService
  // Out: wsObj - webservice-nek megfelelő objektum

  var wsObj = new Object();

  ServiceCertificate();

  try
  {
    wsObj = WebServices.QAComplete.GetVersion();
    var a = 1;
  }
  catch (e)
  {
    Log.Error(e.name + " \r\n" + e.description);
    Log.Message(WebServices.QAComplete.LastRequest.xml);
    Log.Message(WebServices.QAComplete.LastResponse.xml);
  }

  return wsObj;
}

 

 

It's perfect run in TestComplete and TestExecute v10. When I try run it in v10+ TestComplete or TestExecute I give the next error:

JScript runtime error.
Az objektumot kötelező megadni.
Error location:
Unit: "TestAutomata\TestAutomata\Script\_RunWebservice"
Line: 46 Column: 3.

 

I attached the error in picuter.

  • petercsanyi's avatar
    petercsanyi
    5 years ago

    Thanks for your trying!

    I solved the problem! The solution is in the TestComplete parameter.

    Tools > Options > Engines > Web Services > Prefferd Web Service API

    • .NET WCF - Default settings
    • Native

    I changed this parameter to "Native" from default and now my code works all TC version.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What it sounds like is that there is a problem at the root with the QAComplete Web Service.  Something doesn't sound like it's compatible with later versions of TC/TE.

     

    Can you provide screenshots of that web service within the TestComplete project?

    • petercsanyi's avatar
      petercsanyi
      Occasional Contributor

      Thanks for your trying!

      I solved the problem! The solution is in the TestComplete parameter.

      Tools > Options > Engines > Web Services > Prefferd Web Service API

      • .NET WCF - Default settings
      • Native

      I changed this parameter to "Native" from default and now my code works all TC version.