Custom Request Header
Using TestComplete, I want to add in a custom request header. Similarly to how Mod Headers extension in Chrome, I want it to be added to every web request. It needs to allow for a custom key/value set, as it will not be a web standard browser setting. Thanks!Solved29Views0likes4CommentsPOST method with x-www-form-urlencoded body request using testcomplete
we are trying to send http request using GET method and has body parameters in x-www-form-urlencoded as content type . i ended up 400-Bad request always. Following is the sample method which i have created: function test(){ var request,postdata,response; request= aqHttp.CreateGetRequest("https://login.microsoftonline.com/XXXXXXXX/oauth2/V2.0/token"); request.SetHeader("Content-Type","application/x-www-form-urlencoded") postdata="client_id=xxxxx;client_secret=*******" response= request.Send(postdata); Log.message(response.statuscode) Any sample method for this scenario would be helpful. Thanks!22Views0likes3CommentsHow to speed up checking for non-existence of objects in TestComplete?
I'm running into an issue where asserting that an object does NOT exist is taking an unexpectedly long time (~10 seconds) in my TestComplete tests. I've tried using both: if(!Aliases.restOftheCode.exists) and aqObject.CheckProperty("Exists", False) But they both take around 10.25 seconds to execute. I suspect this has to do with some global timeout setting, but I'm not sure exactly which one. Is there a way to override this timeout for just a single test case or step, rather than changing it globally for the entire project? My goal is to make these "object does not exist" checks run much faster, ideally just taking a fraction of a second. Any tips on the optimal way to achieve this would be greatly appreciated!58Views0likes8CommentsUnexpected behavior executing if, elif, else statement in Python
I wrote an if, elif, and else routine to checkpoint a header name and write the appropriate password into a required password field. When I ran the script routine it resulted in unexpected behavior. The first expression (checkpoint function) resulted in true but instead of executing the associated code block (touch & keys) and dropping out it ran the next elif, which as expected failed and then it ran the statements from the previous if statement. It completed the task but ultimately failed the test. I’ve run similar if statements before without issue. Please see attached code snippet and log. Any thoughts as to why this would be happening would be appreciated.Solved59Views0likes7CommentsReferencing an Object and its Properties with GetPropertyValue/CheckProperty
Hello! I recently started working in TestComplete and have just learned about scripts as a way to make more complex test steps. Because my tests will probably be used in the future, one of my ideas was to make a make a script that could compare the current date with a certain textbox and see whether date and value in the textbox object are the same. This would mean that the script always had the current date of the test, rather than a hardcoded value. I thought further that I shouldn't tie this to a certain object in one test, making only that test continuously relevent, I should instead make this script more generic, so I can apply it in multiple tests, or in multiple places in the same test. To do this, I wanted to give my function an argument that would take in a TestComplete object (the objects that are referenced in the test steps). This is what I have tried so far: function DateCheck(dateTextObject) { aqObject.CheckProperty(dateTextObject, "text", cmpEqual, aqConvert.DateTimeToStr(aqDateTime.Today())); } I am planning for the dateTextObject to be the long NameMapped object that I want to pass in, for example: Aliases.browser.pageLeadMainTestcompletetestDyna.sectionQuickCreateContact.sectionDetails4.textboxDate When I passed that into my test, however, it gave me an error that told me there was a Type mismatch. I would appreciate any help you could give to me about this issue. Thanks!20Views0likes4CommentsHow to click last row of the grid?
I want to click on the first cell from the last row in the table ? with Spy , i can fond the name of last row but because the last number of the row depends to the data and data every time change , i want to click on first cell of last row , i mean i want say to the test go find last row and get value of the first cell with (Ctrl+end ) , test is able to find last row but I can't click on it at the same timeSolved209Views0likes3CommentsOCR recognition no longer recognizes newline between keywords
I have a set of TestComplete python scripts which utilize the Intelligent Quality add-on and OCR recognition to test a Windows desktop app. The following code was previously successful: myobj.BlockByText("Log\nIn", spNone) (the intent here is to find a button which contains the words "Log" and "In" on two separate lines of the button label). After upgrading to the latest version of TestComplete (15.63.22.7 x64), this code fails with a "The text 'LogIn' was not found." However, the Full Text output clearly shows that both "Log" and "In" are seen and each of these words is separated by a newline. Another button with a two line label ("New Password") fails in a similar manner. I've tried adding wildcards (e.g., Log*In, Log?In, etc.) but it still fails. If I look at the Full Text output in an editor, I can see that there is a carriage return and linefeed between the words "Log" and "In". Is it possible that I have to represent this differently (than \n) in the latest version of TC and IQ add-on? When I say previously successful, neither the product under test nor the scripts have changed -- the only difference I can think of is that I upgraded to a new version of TestComplete. I would appreciate any assistance or perhaps instructions on how to roll back to a prior version of TestComplete and Intelligent Quality add-on.34Views0likes3CommentsCommenting Out Multiple Lines in TestComplete BDD Scenarios
Hey all, I'm working on BDD scenarios in TestComplete and noticed there's no built-in feature to comment out multiple lines at once, unlike when working on scripts. Any suggestions or workarounds to streamline this? Thanks!80Views1like5Comments