Forum Discussion

GeetaMehta's avatar
GeetaMehta
New Contributor
5 years ago

Http POST request not working with Sys.OleObject("MSXML2.XMLHTTP") on TestComplete 12.10

Hi All,

We have one already developed testcomplete 8 project for windows 7 which has to be run in testcomplete 12.10 version for both windows 7 and 10. When we try to run the solution, we are getting issues with Http Post request while using Sys.OleObject("MSXML2.XMLHTTP").

 

var httpObj = Sys.OleObject("MSXML2.XMLHTTP");

httpObj.open("POST", link, true);

httpObj.send();

 

This httpObj results into error - Member not found into onchangereadystate event and httpObj.readystate is returning 1 always instead of 4. However, the link is working fine - tested into postman tool.

 

Please assist and confirm if the issue is related to testcomplete version compatibility.

Many thanks in advance.

  • Unfortunately, your watchlist screenshot does not help.  As mentioned, this is not a problem with TestComplete or any DLLs or anything that you need to include.  You're instantiating the HTTP object which is a windows object, not a TestComplete object, so you need to go looking at the documentation for that object.

     

    A quick google search found this.

     

    https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/method-or-data-member-not-found-error-461

     

    So, the error that you are getting seems to be indicating that somewhere you're attempting to use some member, property, or method that does not actually exist.


    Here's what I'd suggestion... remove the object from your watchlist...  It MIGHT be that the reason you're getting the error is that the watchlist is generating it, not your actual code.  

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Are you getting the error on the Send?  Or on code after the send?  Which OS are you getting the error on?

    Generally speaking, the problem is most likely not with TestComplete compatibility.  What you're executing is not TestComplete exclusive code but simply creating an instance of an existing Windows OleObject and executing methods on that object.

    • GeetaMehta's avatar
      GeetaMehta
      New Contributor

      Hey Robert,

      Thanks for the prompt response.

       

      The OS used for TestComplete 12.10 tool is Windows 10 64 bit. Additionally, the issue occurs after send() method.Please refer below screenshot for the object details post this method.

      Please confirm if additional dlls or libraries to be imported into tool for JScript code to make it work.

       

      Thanks

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Unfortunately, your watchlist screenshot does not help.  As mentioned, this is not a problem with TestComplete or any DLLs or anything that you need to include.  You're instantiating the HTTP object which is a windows object, not a TestComplete object, so you need to go looking at the documentation for that object.

         

        A quick google search found this.

         

        https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/method-or-data-member-not-found-error-461

         

        So, the error that you are getting seems to be indicating that somewhere you're attempting to use some member, property, or method that does not actually exist.


        Here's what I'd suggestion... remove the object from your watchlist...  It MIGHT be that the reason you're getting the error is that the watchlist is generating it, not your actual code.