Contributions
Re: Win32API Alternative for Script Extensions
TopMost is not a property of the Window class in TC Here is a list of all Window object properties The problem is, when you show a modal form, test execution is paused. So the properties of the window must be edited before the call to ShowModal is made. So ideally, it would be var form = Sys.Process("Test*te").Window("TUserForm", UserForms.UserForm1.Caption, 1); [edit window properties here] UserForms.UserForm1.ShowModal(); And it seems like Win32API is the only thing capable of doing this. Also, the UserForms object itself would also be incapable of this, since it wouldn't have access to all of your operating system's windows.2.4KViews0likes0CommentsRe: Win32API Alternative for Script Extensions
Thanks for the reply, Ryan. Let me clarify a little further. I only need the SetWindowPos function to make a window the topmost window on the screen, not move the window around the screen. Specifically, I need the constant "HWND_TOPMOST". Otherwise, the window I am trying to show gets hidden behind other windows, like the browser. See my first post, and the link to my previous problem that led to this one. The "form" i refer to in my code is actually a modal form in TestComplete. The answer that Alex left in the post in the link above was spot on, but since Win32API is unavailable for script extensions, I need another method that will bring the form window to the top most level.2.4KViews0likes0CommentsWin32API Alternative for Script Extensions
Follow-up questions for :http://smartbear.com/forums/f81/t91301/modal-user-forms-to-be-on-top-of-other-windows/ I need to be able to use Win32API.SetWindowPos() function within a script extension. I know Win32API is not available to script extensions, so is there some alternative I can use? Even coding a function from scratch would be acceptable. I am writing the script extensions in JS. Thanks Nish3.4KViews0likes10CommentsModal User Forms to be on top of other windows.
I am running a test that has a modal form in it that pops up halfway through the test. I am running it via TestExecute. The problem is that whenever the modal form does show, it is never on top, always behind the Internet Explorer window that the rest of the test is using. Is there a way to make a modal form show up on top of all other windows? I tried what was suggested here:http://www.sqaforums.com/showflat.php?Cat=0&Number=478447&an=0&page=0&gonew=1 but this only seems to work for non-modal forms. Thanks NishSolved2.3KViews0likes3CommentsRe: ActiveX Objects are caching HttpRequests (SOAP Requests in JScript)
Okay I figured this one out. A randomized string needs to be present, but not in the envelope header as I thought. Instead, do this: XmlHttpRequest.open("POST", wsdl + "&(new Date()).getTime()", false); append the random string (in this case the timestamp) to the wsdl url in the open call.566Views3likes0CommentsActiveX Objects are caching HttpRequests (SOAP Requests in JScript)
I am sending a SOAP request in JScript using var temp = new ActiveXObject("MSXML2.XMLHTTP.3.0") temp.open("POST", wsdlURL, false) temp.send(env) Now this worked the first time, but it seems to have cached the response, and now I get the same response over and over again. The soap request requires some credentials to be in the soap header, but even if I do not include them, I get the same response back. Is there some way to stop the caching from my end or is something that has to be handled server-side? I looked at some option that allows cache-control to be set in the soap header, but this is illegal in ActiveXObjects (? getting a syntax error). Some side notes: I need to be sending the httprequests in my script and cannot have the webservice url stored in WebServices collection (my testsuite requires that the domain of the wsdl need be changed -- same web service, 9 different domains) I have a set credentials that need to be added to the soap header, which I am doing using a subroutine (not using GeneralEvents for other reasons). I also added a nonce to the header, but that doesnt seem to make a difference in whether I get a fresh response or not. So the "envelope" that I send via ActiveXObject is a complete SOAP requestxml in String format. When I run this same envelope through SOAPUI, I get a non-cached, correct response back. My issue lies in using JScript and ActiveX. I need some kind of way to avoid caching. Thanks in advance.2.3KViews0likes1CommentRe: Web Service returns an array of objects
Thanks for the reply. My goal is to not have the webservice stored in TestComplete, rather just post the soap envelope directly through my script. parseResponse works perfectly when no portion of the returned object is an array, but it appears the array returned is a generic object has cannot be distinguished from a child object. Anyway, I used a brute force method to use to regexp on the returned XML from the XmlHttpRequest post. var XmlHttpRequest = new ActiveXObject("MSXML2.XMLHTTP.3.0"); XmlHttpRequest.open("POST", wsdl, false); XmlHttpRequest.send(test); //test is the soap envelope in xml format (actually just a string with its content) //parse the response var ResponseXml = XmlHttpRequest.responseXML; var re = new RegExp("Blah(.*)Blah", "g"); var match; var results = new Array(); while (match = re.exec(ResponseXml.xml)) { results.push(match[1]); } return results; This will take the reponse given in XML format and read all of the matches of that regexp type and push it onto a single array. Thanks again for the response!1.9KViews1like0CommentsWeb Service returns an array of objects
I am using a web service in which a method returns an array of custom objects. Example: Method Name - GetProducts Input - String Output - ProductType[] where ProductType is an object type that is defined in the web service (just a collection of strings). My problem is after i parse the response returned from the web service, I have no idea how to access this object. I am working in Jscript, so I know I need to convert the array from a VB safe array to a Jscript array, but what is the syntax for doing this? var ResponseXml = XmlHttpRequest.responseXML; var response = webservice.ParseResponse("GetProducts", ResponseXml); The "response" object should contain a reference to the array of ProductTypes. Now, how do I go about accessing the array from the response? var array = (new VBArray(________?______).toArray(); Thanks in advance4.5KViews0likes2Comments