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.
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.