I'm REALLY struggling with the recorded drag\drop :/ It's easily my least reliable test and I hate that I have to maximize the browser as a step to get it to work even slightly.
Is there no way to like get the position of the box, then get the height of the first item to then calculate the drag height or something?
http://demos.telerik.com/kendo-ui/sortable/index
This is the generated drag code...
[CodedStep(@
"Drag First item to second place"
)]
public
void
CpsPlacementsRanking_DragItem()
{
// Drag First item to second place
Pages.ClinicalPlacements.RankableLocationFirstItem.Wait.ForExists(30000);
ActiveBrowser.ResizeContent(2577, 25, 2093, 1297);
ActiveBrowser.ScrollBy(0, 0);
Pages.ClinicalPlacements.RankableLocationFirstItem.DragToWindowLocation(ArtOfTest.Common.OffsetReference.TopLeftCorner, 333, 19,
true
, ArtOfTest.Common.OffsetReference.TopLeftCorner, 1127, 300,
true
);
}
5 Answers, 1 is accepted
Thank you for the detailed description.
Please find further details how to add a verification image step and what adjustments you could manuallt apply to it. I hope this will be helpful to you to build the appropriate step as per your requirements.
Please let me know if additional assistance is required. Thanks!
Regards,
Elena Tsvetkova
Telerik by Progress
Hi, apologies for getting back so late...
I don't need image verification, I need to be able to properly (reliably) pull off a drag\drop is the problem. I need to be able to calculate the elements such that it'll work every time instead of having to re-wrestle with the thing every few months when something changes. It's also really annoying for the test to have to go fullscreen.
Thoughts?
There is an article that explains all available methods related to DragTo() method available in Telerik Testing Framework. I hope that you could find there the one that will make your tests more stable.
There is .ScrollToVisible() method on an element that might obsolete the maximization of the window.
Please provide more specific case details in order be able to provide further assistance.
Regards,
Nikolay Petrov
Telerik by Progress
The problem isn't the dragdrop otself, the problem is it uses measurements. I'm looking for some way to do those measurements in code so it doesn't matter where the window is or if the drag items change padding.
I can do all the math, just looking for the api i guess to try?
Thanks for getting back to us.
Please find attached a test that logs to the execution log the coordinates and size of a html element. This is the "Try it" button on the page. Please note that you have to add reference to System.Drawings.dll in your project to be able to use the provided code.
I hope this will be useful to you.
Regards,
Elena Tsvetkova
Telerik by Progress