Hack Forums
[C#] Smooth drag and drop (Selenium) C# - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Smooth drag and drop (Selenium) C# (/showthread.php?tid=6084689)



Smooth drag and drop (Selenium) C# - draxyee - Jun 4, 2020

How could I do this?

I'm currently using this:

PHP Code

<?php 
for(int offsetIndex = 0; offsetIndex < location.X - 5; offsetIndex+=5)
                    {
                        var 
dragAndDrop = builder.ClickAndHold(dragElement).MoveByOffset(5, 0).Build();

                        
dragAndDrop.Perform();

                        
Thread.Sleep(1);
                    } 

But it's slow and choppy, I'd love something that is smooth and preferably an exponential curve of drag.

Thank you!


RE: Smooth drag and drop (Selenium) C# - Porn - Jun 5, 2020

(Jun 4, 2020 06:00 PM)draxyee Wrote:  How could I do this?

I'm currently using this:

PHP Code

<?php 
                   for
(int offsetIndex = 0; offsetIndex < location.X - 5; offsetIndex+=5)
 
                   {
 
                       var dragAndDrop = builder.ClickAndHold(dragElement).MoveByOffset(5, 0).Build();

 
                       dragAndDrop.Perform();

 
                       Thread.Sleep(1);
 
                   } 

But it's slow and choppy, I'd love something that is smooth and preferably an exponential curve of drag.

Thank you!

Selenium can drag X element to Y element. In order for it to go smoothly drag X to Y you'd have to supply all of the coordinates in between?