petercsanyi
6 years agoOccasional Contributor
"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.
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.