Contributions
Re: I want to integrate Test Complete with Postgres DB
https://community.smartbear.com/t5/TestComplete-Desktop-Testing/I-want-to-integrate-Test-Complete-with-Postgres-DB/td-p/136731 With the help of above thread, I am successfully able to get the results from my database. But, it provides with only one result at one time, as the code states --if (noOfRecords == 1). My query gives multiple rows, and hence the error. What could be the best possible solution for this. Also, i want to email the results of this query. Please suggest. Thanks, -Nitin3.1KViews0likes0CommentsRe: not able to use Drag method
Hi Alex, I have verified formemberdragTo too.. It is fine. The error is thrown at this line : let toX = memberdragFrom.Left - memberdragTo.Left +memberdragTo.Width / 2; and the error says - You are trying to call the "Left" method or property of an object that does not exist. So, it clearly depicts that test complete is not able to recognize these two- memberdragFrom = page.Find(new Array("class", "index"), new Array("name cdk-drag", 1), 20000); memberdragTo = page.Find(new Array("class", "index"), new Array("*dragHere*", 2), 20000);1.3KViews0likes1CommentRe: not able to use Drag method
Yes Alex. Both class names and index are correct. I have re-verified. function test(){ let page = Sys.Browser("*").Page("*"); let dragfro = page.contentDocument.getElementsByClassName("name cdk-drag"); Log.Message(dragfro.length); for (let i = 0; i < dragfro.length; i++){ p = dragfro.item(i).innerText; Log.Message(p) } }1.4KViews0likes3CommentsRe: not able to use Drag method
This is the code I am using --- function Drag_Smartbear(){ let page = Sys.Browser("*").Page("*"); memberdragFrom = page.Find(new Array("class", "index"), new Array("name cdk-drag", 1), 20000); memberdragTo = page.Find(new Array("class", "index"), new Array("*dragHere*", 2), 20000); Log.Message(memberdragFrom) Log.Message(memberdragTo) if (!(memberdragFrom.Exists && memberdragTo.Exists)){ Log.Message("cannot be dragged") }else { Log.Message("Yay ! cann be dragged") } let toX = memberdragFrom.Left - memberdragTo.Left +memberdragTo.Width / 2; Log.Message(toX); let toY = memberdragFrom.Top - memberdragTo.Top +memberdragTo.Height / 2; Log.Message(toY); memberdragFrom.Drag (memberdragFrom.Width / 2, memberdragFrom.Height / 2, toX, toY, skNoShift); }1.4KViews0likes5CommentsRe: not able to use Drag method
Hey Alex, Yeah ! i tried increasing the depth. That ways, i don't get the invalid parameter error as before. But, still it is not able to findmemberdragFrom andmemberdragTo. It says - object cannot be found.. Is their any other approach i can follow ? Thanks for your patience.1.4KViews0likes7CommentsRe: not able to use Drag method
Hey Alex, Thank you for trying so much on this with me. I really appreciate your efforts. I changed it to : memberdragFrom = page.Find(new Array("class", "index"), new Array("*name cdk-drag*", 1), -1); memberdragTo = page.Find(new Array("class", "index"), new Array("*dragHere*", 2), -1); But still i am getting the same error for these 2 : Invalid parameters are specified. Maybe. something wrong the the technical architectureof this page. If this does not works, can we try something else for drag and drop ? I tried changing the depth, but the error seems to be the number or type of parameters?1.9KViews0likes9CommentsRe: not able to use Drag method
Hi Alex, As per your suggestion, this is the code which i am using but it gives me as error for memberdragFrom & memberdragTo both, saying - "Invalid parameters specified" function Drag_Smartbear(){ let page = Sys.Browser("*").Page("*"); memberdragFrom = page.Find(["class", "index"], ["*name cdk-drag*", 1], -1); memberdragTo = page.Find(["class", "index"], ["*dragHere*", 2], -1); if (!(memberdragFrom.Exists && memberdragTo.Exists)){ Log.Message("cannot be dragged") }else { Log.Message("Yay ! cann be dragged") } let toX = memberdragFrom.Left - memberdragTo.Left +memberdragTo.Width / 2; Log.Message(toX); let toY = memberdragFrom.Top - memberdragTo.Top +memberdragTo.Height / 2; Log.Message(toY); memberdragFrom.Drag (memberdragFrom.Width / 2, memberdragFrom.Height / 2, toX, toY, skNoShift); }1.9KViews0likes11CommentsRe: not able to use Drag method
let memberdragFrom = page.Find("class", "*name cdk-drag*", -1); Here, there are 2 elements with the same class name, and i want to pick the 2nd one. Similarly, formemberdragTo, there are 3 elements with the same class name(dragHere), and i want to pick the 3rd one. I am not able to find unique identifiers for these two. That is why in my example above, i was using item(1) and item(2) to pick 2nd and 3rd item of the same name class. I am sorry to bug you again and again, but i am scratching my head and trying codes, but nothing is working for me.2KViews0likes14Comments