Forum Discussion
You can use this function to drag an object to another object:
// JScript
// Drags the source object to the specified destination object
function DragToObject(source, destination) { var point1 = source.WindowToScreen(source.Width/2, source.Height/2); var point2 = destination.WindowToScreen(destination.Width/2, destination.Height/2); source.Drag(source.Width/2, source.Height/2, point2.X - point1.X, point2.Y - point1.Y); }
Here's a demo for the http://html5demos.com/drag page:
function DragDropTest() { var strUrl = "http://html5demos.com/drag"; Browsers.Item(btIExplorer).Run(strUrl); var page = Sys.Browser().Page(strUrl); // Drag&drop "two" into the trash bin var item = page.FindChildByXPath("//a[@id='two']"); var trash = page.FindChildByXPath("//div[@id='bin']"); DragToObject(item, trash); }
- Veroniquelu10 years agoContributor
I found "<a title="" class="jstree-anchor jstree-clicked" href="#"><i class="jstree-icon jstree-themeicon jstree-themeicon-custom" style='background-position: center; background-image: url("/Images/treeView/icon_book_black.png"); background-size: auto;'></i>course1</a>" object
But it says it doesn't support this method..
- AlexKaras10 years agoChampion Level 3
Hi,
How did you search for the object?
Can you provide us with your actual code, exact line of error and the error text iteself?
- Veroniquelu10 years agoContributor
I think I figured out what went wrong, when trying to find the object by the first method, along with all these parent/sibling, the object becomes a non-testcomplete object, that's why it's not supported, so I've changed my code by using xpath to find it correclty, it works like a charm.. Thank you very much, Both of you :D
Related Content
- 6 years ago
- 3 months ago
- 3 years ago
- 2 years ago
Recent Discussions
- 4 days ago
- 4 days ago
- 8 days ago