开发者

Post data on Web using C++ Script

I am using TestComplete 7. In this for configuration I have to post XML on web at specified IP and port ad开发者_运维问答dress. I am using C++ Scripting language. How can I do this? or if there is other way to do same using interface and without scripting??


Looks like you need something like this:

  XmlHttpRequest = new ActiveXObject("MSXML2.XMLHTTP.3.0");
  XmlHttpRequest.open("POST", "http://camera.ip/configuration_page", false);
  XmlHttpRequest.send("<?xml version="1.0" ?> <Config> <Video_Input_Source>IP CAM 3</Video_Input_Source> </Config>");

This is JScript. This code will work in a C++Script TC project. But there may be problems with the "new ActiveXObject" statement in a C++ application if you put the code there. So, you will need to modify the code to use a different way to create the same "MSXML2.XMLHTTP.3.0" object in your C++ app. The idea remains the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜