Contributions
elevated privileges for starting testcomplete remotly?
Hi, I have a problem to start TestExecute/TestComplete from asp.net project. If I start it from cmd it's work fine but if I try to start it from asp.net I get a message like: "the requested operation requireselevated privileges". Has someone experience with this issue?934Views0likes2CommentsRe: Empty Span Elements
Ok, so I have another problem with spans: spans on my page have "idStr" but TestComplete does not recognize it. a litle code snippet from my site: <div class="bla" id="myDiv"> <span class="mySpan" id="spanOfDiv" onclick="doSomething()">A short Text about a sleeping Cat</span> </div> I use following function to search for span: FindChild("idStr", "spanOfDiv", 10) Anybody else here with the same problem or does anyone know a solution?1.8KViews0likes0CommentsRe: How can I clone objects in TestComplete javascript?
It is only an example... 1.) the the second argument in functions head was important for me, because: function clone( other, obj) if this function return an object to an object is that like : var myObj = otherObj; so its save the reference from otherObj to myObj and the function that I have posted works with the real variable.( my opinion) 2.) The idea is: this function is for objects, functions and for standard types like: string or int, float, double, therefore the function don't return false on this: if((other === null) || (typeof other !== "object")) { obj = other; return true; } thanks for answer, the code has become shorter.3.2KViews0likes1CommentRe: How can I clone objects in TestComplete javascript?
So here is my solution for this Problem. We do not have the the option for using 'prototype' or 'constructor'. I havemy doubts in terms of this kind of solution but it's better then nothing: function clone( other, obj) { if ( (other === null) || (typeof other !== "object") ) { obj=other; return true; } obj = obj || {}; for ( Key in other ) { if(other.hasOwnProperty(Key)) { if(typeof other[Key] == 'function') { obj[Key]={}; eval("obj."+Key.toString()+"="+other[Key].toString()); } else if(typeof other[Key] == 'object') { obj[Key]={};// clone(other[Key], obj[Key]); } else { obj[Key]=other[Key]; } } } if(obj != null)return true; return false; } Usage: var person={ fName: "Max", lName: "Mustermann", hight: 181, motto:{ autor:"mySelf", text:"my motto", printMotto: function(){ return (this.autor+" : "+this.text); } }, printData:function(){ return this.fName+" ->"+this.lName+" -> "+this.hight+"->"+motto.printMotto(); } }; var copy={}; if(clone(person, copy)) Log.Message(person.printData()+" :: "+copy.printData()); person=null; // or you can use undefined to clear var Log.Message(copy.printData()); Log.Message(person.printData());// here we will get an error I can't compare the memory address of this both variables, so it's not really 100% a deep copy If you have a better way to solve that problem, post it here. Thanks.3.2KViews0likes3CommentsHow can I clone objects in TestComplete javascript?
Hi, a simple Question: how can I clone objects, in javascript without reference, in TestComplete(is it possible)? I don't found a methode on MSDN and the standard methode "clone()" is not supported by TestComplete. little example: var p={ // simple object pName:"myName", pSex:"Male", pToStr: function(){ return (this.pName+" : "+pSex);} } var tmp={}; clone(p, tmp); p.Name="yourName"; if(p.Name==tmp.Name) // should be different Print(Error); else Print("was cloned");Solved3.3KViews0likes4Commentsget textbox from a html table cell
Hello, I have a problem to access the input( a simple TextBox ) from html table cell. Here is a little example of structure from my Table: <table> <tbody> <tr id="row_1"> <td ="description" >Here is the input number 1</td> <td> </tr> <tr id="row_1"> <td ="description" >Here is the input number 1</td> <td> <td id="input_cell_1"> <input id="input_1" type="text" > </td> </tr> <tr id="row_2"> <td ="description" >Here is the input number 2</td> <td> <td id="input_cell_2"> <input id="input_2" type="text" > </td> </tr> ........... <tr id="row_n"> <td ="description" >Here is the input number n</td> <td> <td id="input_cell_n"> <input id="input_n" type="text" > </td> </tr> </tbody> </table> I have tried the Find and FindChild methods, but I get this error message: "This Object do not support this property or methode.". Here is the funktion that I wrote: function GetACellTextBox(myTable, cellIdStr) { if(myTable!=null) { if(aqString.Compare(cellIdStr, "", false)!=0) { var tBody, tRow, tCell, tInput; for(var t=0; t<myTable.tBodies.length; t++) { tBody=myTable.tBodies.item(t); for(var i=0; i<tBody.rows.length; i++) { tRow=tBody.rows.item(i); for(var j=0; j<tRow.cells.length; j++) { tCell=tRow.item(i).cells.item(j); tInput=tCell.Find("tagName", "input", 5); if(tInput!=null) { // compare the idString with cellIdStr // if equals then return tInput; // this is not the problem } } } } } else Print("GetACell: cellIdStr is NULL.") } else Print("ClickOnACell: Object "+myTable+" is leer."); return null; } I can not use Find Methods for tRow and tCell, becauseI getthe same error message again and again. What I search for is something like this tCell.GetContent() or tCell.firstChild. And yes, I can use the Find Methode like this myTable.FindAllChildren("tagName", "input", 50), but this is not ok for me. Is it possible to get the content from a html table cell? I really appreciate any help you can provide.Solved1.2KViews0likes1Comment