KevinZesiOccasional ContributorJoined 5 years ago9 Posts6 LikesLikes received2 SolutionsView All Badges
ContributionsMost RecentMost LikesSolutionsRe: Array.splice() does not work I found the solution / my error and post it here, just in case someone is interested. As it is stated here, you need to convert TestComplete arrays into native arrays. Array.splice() does not work Hi everyone, I got a new problem with TestComplete and JavaScript. I want to remove an element in an array at index X and tried to use the splice method as it does exactly what I want to do. My code looks something like this: function someFunction() { var myArray = page.EvaluateXPath(...); for (var i = 0; i < myArray.length; i++) { // do something... myArray.splice(i, 1); // remove element at index i if it matches criteria break; } } now during debugging/testing if everything works fine, TestComplete tells me that "myArray.splice is not a function" and stops the test. Well... why does it not work? Obviously it is a function. the splice function is mentioned here too (I know it's from 2016). Can anyone help me with this? Or are there other methods since 2016? Cheers, Kevin SolvedRe: Date.toLocaleString not working FYI: last friday I got a reply from the TestComplete Support. it is mentioned in the documentation, that the Internationalization API is not supported in javascript here: https://support.smartbear.com/testcomplete/docs/scripting/specifics/javascript.html#Unsupported and as the Support suggested, I opened a feature request to implement this functionality here: https://community.smartbear.com/t5/TestComplete-Feature-Requests/Internationalization-API-Support/idi-p/203134#M2253 cheers. Internationalization API Support I want to submit the support for the Internationalization API as I tried to use it myself here: https://community.smartbear.com/t5/TestComplete-General-Discussions/Date-toLocaleString-not-working/td-p/202534 and in 2018 the user Muts here: https://community.smartbear.com/t5/TestComplete-Functional-Web/Javascript-toLocaleString/m-p/158445#M31749 in the documentation it is mentioned that it is not supported here: https://support.smartbear.com/testcomplete/docs/scripting/specifics/javascript.html#Unsupported I am sure that TestComplete is not only used in english speaking languages, so it would be nice to write Tests that are time critical or have a heavy use of time stamps and do some math with times in the local time and date format. It would be nice and I hope, some more users need want this too. 😃 have a nice day all. Re: Date.toLocaleString not working Thanks to both of you, I highly appreciate that. As tristaanogre mentions, I use the aqConvert for now, thank you for suggesting. Support issue will be created. Date.toLocaleString not working Hello there, I have a question regarding the Date object in JavaScript. I want to use the following: function myFunction() { ... var myDate = new Date(year, month-1, day); var options = { year: 'numeric', month: '2-digit', day: '2-digit' }; Log.Message("myDate...", "myDate is: " + myDate.toLocaleString('de-DE', options)); // expected: 02.06.2020 // result: Mon Jun 02 2020 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit) } as you can see in my test log message I get a different result. does TestComplete not support this method or am I using it wrong? the ECMAScript specification of the Date object is this: https://www.ecma-international.org/ecma-262/6.0/#sec-date-objects and TestComplete uses ECMAScript 6 for JavaScript, as it is stated here: https://support.smartbear.com/viewarticle/77297/ so I thought I can use this method of Date. any suggestions? help? thanks in advance, Kevin SolvedRe: NodeBitmaps: what are they for? Got an answer from Support: Support wrote: "These XML nodes are the small icons that you see in the KDT editor on the left side of the top-level object nodes. Not all KDT nodes have icons in this format. I believe that icons in this format are created only for top-level windows. I do not think that there is any way to disable them. At least not in the GUI." so these are just the small icons for chrome or firefox browser and not something that can break my test. so I can ignore them from now on. but I have to say: the solution to store these icons in the XML file is a bit ... weird. with this huge encrypted (?) data segment. this could be implemented in a better way just like something like this: <Nodebitmaps> <Bitmap Name="Aliases.Browser" Data="chrome_icon"> </NodeBitmaps> but this is just my opinion. wish you all the best and thanks for contributing. Kevin Re: NodeBitmaps: what are they for? technically yes, but there is no answer to it, only that it is adressed for future releases and is from 2013. so I hoped by the time it had been worked on. NodeBitmaps: what are they for? hello, I have a question regarding the NodeBitmaps node within the keyword test files. what is the purpose of those? and is there a way to stop testcomplete to change the keyword Tests when they are not touched by me in any way? see appended screenshot. reason is that it annoys me when I want to commit my changes into git and öinstead of one or two files that have changes there are many more because of the NodeBitmaps. I think it has something to do with the screenshots testcomplete takes during testing, but I can not find anything about it in the forums, Support or documentation. and I don't upload any image due to an entry in my .gitignore file. because we don't need them. I hope someone can help me on this topic. Kevin Solved