Ask a Question

IXMLDOMDocument in Python to call SOAP from testcomplete?

wt0vremr
Occasional Contributor

IXMLDOMDocument in Python to call SOAP from testcomplete?

Hello. I'm usint TestComplete 11 at work. So.

Let's say I have a web service in TestComplete, called PetService.

Here's my code. I wrote it after reading TC docs related to SOAP testing.

 

 

def run():
  WebServiceInfo = WebServices.CreateWebServiceInfoFromItem("PetService")
  requestObj = WebServiceInfo.PrepareRequestObject("GetClientPets")
  requestObj['clientCode'] = 2947
  WebServiceInfo.PrepareRequest("GetClientPets", requestObj)
  

 

 

Now I need to send the request, get the response and parse it. I tried to create XmlHttpRequest, but all my attempts failed.

By the way, TestComplete documentation is still missing some useful python examples.

4 REPLIES 4
wt0vremr
Occasional Contributor

Re: IXMLDOMDocument in Python to call SOAP from testcomplete?

Also I tried:

  WebServiceInfo.PrepareRequest("GetClientPets", requestObj).save("C:\text.txt")

Which gave me a .txt file containing 3 zeros.

AlexKaras
Community Hero

Re: IXMLDOMDocument in Python to call SOAP from testcomplete?

Hi,

 

I guess that your code is based on the http://support.smartbear.com/viewarticle/70743/ help article and you made it too complex. 🙂

Manual creation of requests is a rare thing with TestComplete and may be needed for a few special cases only (e.g. when testing asynchronious web services). In all other cases Web Services Editor is very useful and assists in creation of a simple and clear test code.

I would recommend to start from http://support.smartbear.com/viewarticle/68323/ topic and follow the recommendations.

 

If you can post here or send me (via the forum mail) the WSDL file for your web service I can provide you with the sample code.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
wt0vremr
Occasional Contributor

Re: IXMLDOMDocument in Python to call SOAP from testcomplete?

Unfortunately, my WSDL is internal use only, and it's illegal to expose it outside the company.

I described my purpose above, I need ability to work with the response.

 

AlexKaras
Community Hero

Re: IXMLDOMDocument in Python to call SOAP from testcomplete?

Hi,

 

In this case I would recommend to go through the help section that I mentioned. Also take a look at the sample test project from the C:\Users\Public\Documents\TestComplete 11 Samples\Common\Web Service Testing\Functional Testing\ folder and use it as a sample.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: