cancel
Showing results for 
Search instead for 
Did you mean: 

How do I find an Object if there's scroll bar involved? And how to Drag and Drop them?

SOLVED
Contributor

Re: How do I find an Object if there's scroll bar involved? And how to Drag and Drop them?

So in order to achive that, I replaced .Drag, Please see the code below:

function DragToObject(source, destination)
{
sDelay = 1000;
source.ScrollIntoView(false);
var point1 = source.WindowToScreen(source.Width/2, source.Height/2);
LLPlayer.MouseDown(MK_LBUTTON, point1.X, point1.Y, sDelay);

destination.ScrollIntoView(false);
var point2 = destination.WindowToScreen(destination.Width/2, destination.Height/2);
LLPlayer.MouseMove(point2.X, point2.Y, sDelay);
LLPlayer.MouseUp(MK_LBUTTON, point2.X, point2.Y, sDelay);

}

 

 

This works for me. Thank you all for being so nice and kind Smiley Happy

Community Hero

Re: How do I find an Object if there's scroll bar involved? And how to Drag and Drop them?

I would say 'Wow!' and thank you for sharing your finding Smiley Happy

It is really good to know that LLPlayer and .ScrollIntoView can be used together and work as expected. Nice and useful trick.

 

To Support: Don't you think that this is worth to be mentioned in the 'TestComplete How To' ?

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Community Hero

Re: How do I find an Object if there's scroll bar involved? And how to Drag and Drop them?

"To Support: Don't you think that this is worth to be mentioned in the 'TestComplete How To' ?"

 

+1 agreed!!!

 

Scrolling and drag'n'drop are two of the most common causes of problems and questions on here .....

Occasional Contributor

Re: How do I find an Object if there's scroll bar involved? And how to Drag and Drop them?

I am using angular based application and for me i tried simple method and it worked

 

e.g. (In Python+ TestComplete)

 

devModel = AllDevicesPageObject.devModelHeader(page);
devModel.Click();
devModel.scrollIntoView(True);
devModel.MouseWheel(8,skNoShift);

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors