Contributions
Re: Is it possible to log JavaScript errors during test runs?
Hi, Use exception handling. 'Exception handling On Error Resume Next Err.Clear ' here you handle the exception ArraryVerify = Response.return.assetTrackVOs(0).assetId ' write your hadle code if Err.Number <> 0 then ' An exception occurred log.Error Err.Number Log.Error Err.Description end if934Views0likes0CommentsRe: How to send testcomplete results to excell sheet
Hi , I think below link is use ful for you and i am using this and implemented in Test complete. http://blogs.technet.com/b/heyscriptingguy/archive/2005/01/31/how-can-i-make-changes-to-and-then-re-save-an-existing-excel-spreadsheet.aspx Regards, Praveen P1.5KViews0likes0CommentsRe: Export Test Results To Excel Sheet
''''Excel: Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add intRow = 2 objExcel.Cells(1, 1).Value = "starttrack" 'Your Existing Vbs Script Goes Here. A= "PASS" B="FAIL" If VRes_code=Code_number Then Log.Message "Responce Code:"+VRes_code+" PASS" objExcel.Cells(intRow, 1).Value = A else objExcel.Cells(intRow, 1).Value = B Log.Error "Responce Code:"+VRes_code+" FAIL" end if6KViews0likes0Comments- 1.2KViews0likes0Comments
Re: Adding Header to the web services in test complete
Hi Alex, Here is the end solution. Function LandmarkVO Set ServiceInfo = WebServices.CreateWebServiceInfoFromItem("DeviceManagementService") Set HomeGprsIpVO = ServiceInfo.TypeFactory.HomeGprsIpVO HomeGprsIpVO.gprsId=null HomeGprsIpVO.ipAddress="192.168.1.5" HomeGprsIpVO.lastUpdated="" HomeGprsIpVO.name="Praveenhjlllllk" HomeGprsIpVO.port="5006" HomeGprsIpVO.status=1 HomeGprsIpVO.updatedBy=null Set RequestObj = ServiceInfo.PrepareRequestObject("createHomeGPRSIP") Set RequestObj.args0 = HomeGprsIpVO Set RequestXml = ServiceInfo.PrepareRequest("createHomeGPRSIP", RequestObj) Set Root = RequestXml.documentElement Set HeaderElement = RequestXml.createElement("s:Header") Set HeaderNode = Root.insertBefore(HeaderElement, Root.childNodes.item(0)) Set usernameElement = RequestXml.createNode(1, "userName", "") Set usernameNode = HeaderNode.appendChild(usernameElement) Set usernameValueElement = RequestXml.createTextNode("Admin") usernameNode.appendChild(usernameValueElement) Set pwdElement = RequestXml.createNode(1, "password", "") Set pwdNode = HeaderNode.appendChild(pwdElement) Set pwdValueElement = RequestXml.createTextNode("password") pwdNode.appendChild(pwdValueElement) ' Set ipaElement = RequestXml.createNode(1, "ipaddress", "") ' Set ipaNode = HeaderNode.appendChild(ipaElement) ' Set ipaValueElement = RequestXml.createTextNode("10.10.10.10") ' ipaNode.appendChild(ipaValueElement) ' ' Set pidElement = RequestXml.createNode(1, "portalId", "") ' Set pidNode = HeaderNode.appendChild(pidElement) ' Set pidValueElement = RequestXml.createTextNode(1) ' pidNode.appendChild(pidValueElement) Log.Message "See XML in the Additional Information pane", RequestXml.xml ' Sending the request Set XmlHttpRequest = CreateObject("MSXML2.XMLHTTP.3.0") ' Insert the correct service URL Call XmlHttpRequest.open("POST", "https://devtest.idigi.com/mobile/services/DeviceManagementService.DeviceManagementServiceHttpSoap11Endpoint/", False) Call XmlHttpRequest.send(RequestXml) ' Log.Message WebServices.DeviceManagementService.LastResponse Set ResponseXML = XmlHttpRequest.responseXML Call Log.Message("See the response XML in the Additional Information pane", responseXML.xml) Set Response = ServiceInfo.ParseInfo("createHomeGPRSIP", ResponseXML) Call Log.Message("Entity ID: " & Response.code) End Function Regards, Praveen1.5KViews1like0CommentsRe: How to run the WebServices test
Alexei , from the below code i am able to get the response. [VBScript] Set ResponseXML = XmlHttpRequest.responseXML Call Log.Message("See the response XML in the Additional Information pane", responseXML.xml) Set Response = ServiceInfo.ParseInfo("createLandmark", ResponseXML) Call Log.Message("Entity ID: " & Response.entityId) //// Then you can parse the XML response (ResponseXML) as you need or work with the parsed object (Response). Using the Response object i am getting all the response parameter results. Now i am able to send the header along with request object, getting the response object. So now i am able to test the Webservice Testing using Test complete. Thanks for all. Regards, Praveen1.2KViews0likes0CommentsRe: How to run the WebServices test
Hi Alexei , Yes your b point: there is no method required to be called initially and authentication data must be provided as a parameters for any method. is there my project. http://support.smartbear.com/viewarticle/29074/ help article. and got below from smartbear QA Function LandmarkVO Set ServiceInfo = WebServices.CreateWebServiceInfoFromItem("DeviceManagementService") Set HomeGprsIpVO = ServiceInfo.TypeFactory.HomeGprsIpVO HomeGprsIpVO.gprsId=null HomeGprsIpVO.ipAddress="192.168.1.5" HomeGprsIpVO.lastUpdated="" HomeGprsIpVO.name="Praveenhjlllllk" HomeGprsIpVO.port="5006" HomeGprsIpVO.status=1 HomeGprsIpVO.updatedBy=null Set RequestObj = ServiceInfo.PrepareRequestObject("createHomeGPRSIP") Set RequestObj.args0 = HomeGprsIpVO Set RequestXml = ServiceInfo.PrepareRequest("createHomeGPRSIP", RequestObj) Set Root = RequestXml.documentElement Set HeaderElement = RequestXml.createElement("s:Header") Set HeaderNode = Root.insertBefore(HeaderElement, Root.childNodes.item(0)) Set usernameElement = RequestXml.createNode(1, "userName", "") Set usernameNode = HeaderNode.appendChild(usernameElement) Set usernameValueElement = RequestXml.createTextNode("Admin") usernameNode.appendChild(usernameValueElement) Set pwdElement = RequestXml.createNode(1, "password", "") Set pwdNode = HeaderNode.appendChild(pwdElement) Set pwdValueElement = RequestXml.createTextNode("password") pwdNode.appendChild(pwdValueElement) ' Set ipaElement = RequestXml.createNode(1, "ipaddress", "") ' Set ipaNode = HeaderNode.appendChild(ipaElement) ' Set ipaValueElement = RequestXml.createTextNode("10.10.10.10") ' ipaNode.appendChild(ipaValueElement) ' ' Set pidElement = RequestXml.createNode(1, "portalId", "") ' Set pidNode = HeaderNode.appendChild(pidElement) ' Set pidValueElement = RequestXml.createTextNode(1) ' pidNode.appendChild(pidValueElement) Log.Message "See XML in the Additional Information pane", RequestXml.xml ' Sending the request Set XmlHttpRequest = CreateObject("MSXML2.XMLHTTP.3.0") ' Insert the correct service URL Call XmlHttpRequest.open("POST", "https://devtest.idigi.com/mobile/services/DeviceManagementService.DeviceManagementServiceHttpSoap11Endpoint/", False) Call XmlHttpRequest.send(RequestXml) End Function Above one works for me and inserted into DB. I tried to get the result. so i passed the my object to that service in the above same function a=WebServices.DeviceManagementService.createHomeGPRSIP(HomeGprsIpVO) Res=a.code MsgBox Res Getting the error message as An Item with the same key has already added. Can you please provide the how i can get the Result values.3.2KViews0likes0CommentsRe: How to run the WebServices test
Hi AlexeiKaras, You are gving hope to continue with this. Thanking you. Yes. Authuntication paramerters has some other Webservices and other method below is the code: Dim TypeFactory1 'Get the type factory for the web service Set TypeFactory1 = WebServices.LoginService.TypeFactory Set UserVO = TypeFactory1.UserVO UserVO.userName="Admin" UserVO.password="password" UserVO.ipAddress="10.10.10.10" UserVO.portalId=1 But how i canadd this Object(UserVO) to the below Service/method Dim TypeFactory 'Get the type factory for the web service Set TypeFactory = WebServices.FleetManagementService.TypeFactory Set HomeGprsIpVO = TypeFactory.HomeGprsIpVO HomeGprsIpVO.gprsId=null HomeGprsIpVO.ipAddress="192.168.1.1" HomeGprsIpVO.lastUpdated="" HomeGprsIpVO.name="Praveen" HomeGprsIpVO.port="5005" HomeGprsIpVO.status=1 HomeGprsIpVO.updatedBy=null res= WebServices.FleetManagementService.createHomeGPRSIP(HomeGprsIpVO) Now i have UserVO, HomeGprsIpVO two objects. I can't pass UserVO to the above service , because it can't support. Please advise.3.2KViews0likes0CommentsRe: How to run the WebServices test
Hi Alex, below is my context: I followed the steps below: 1. Open the Test Complete 2. Added the Web service Project. 3. Navigate to the Web service node 4. Click on Add 5. select the WSDL in the popup(https://devtest.idigi.com/mobile/services/DeviceManagementService?wsdl) 6. Click on Get services 7. Populate the Tested service and Click on OK Button in the Pop up 8. I got the Types and Methods listed for that services. Script: 1. Open the New Script file 2. added the code below: Function HomeGprsIpVO Dim TypeFactory 'Get the type factory for the web service Set TypeFactory = WebServices.FleetManagementService.TypeFactory Set HomeGprsIpVO = TypeFactory.HomeGprsIpVO HomeGprsIpVO.gprsId=null HomeGprsIpVO.ipAddress="192.168.1.1" HomeGprsIpVO.lastUpdated="" HomeGprsIpVO.name="Praveen" HomeGprsIpVO.port="5005" HomeGprsIpVO.status=1 HomeGprsIpVO.updatedBy=null res=WebServices.FleetManagementService.createHomeGPRSIP(HomeGprsIpVO) a=res.code MsgBox a End Function I am getting the error as"User Creditionals Required", Because of that service don't have the Header part <soapenv:Header> <username>Admin</username> <password>password</password> <ipaddress>172.80.1.55</ipaddress> <portalId>1</portalId> </soapenv:Header> Using Soap UI, i am adding above header part externally to that Particular service and run. It is executing- Correct. But i don't have option to modify service in the Test complete. So , i need to add the only Header part without changing the service for that service while executing. Then only i will get the result. I read thearticle http://support.smartbear.com/viewarticle/29074/ before sending this . But, in that example, it is converting Header part as well as Web service standard code in to xml. I want add the Header part and append to existing Web service. ------------------------------- Hi Sergei Sokolov, This is for functional testing using Test complete 9, but in the form unfortunately started as in Load complete. Regards, Praveen Kumar P.3.2KViews0likes0Comments