Jump to content

Is it possible to automate drag and drop feature in a website?

Recommended Posts

I saw few UDFs related to IE and Firefox to automate tasks related to these browsers.


But is it possible to automate tasks like drag and drop in the website.?

Like in the below video.

If not can you tell me some alternatives, as it is not possible in selenium as I heard.


Share this post

Link to post
Share on other sites

In udf I am able to click or get any elements based on id, but didn't find option to drag and drop it on somewhere.

And the Google didn't provide any valid results for drag and drop option in ie.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By kingjacob90
      Hay guys
      Just had an idea and wanted to know where to start. I want to download a screenshot of a website automatically into a .png .jpg ect format so I can then set it as my desktop background.
      This might be for for news: When the latest news is added to a website a screenshot of that website is saved and added to my desktop background.
      I have tried using website that already do the screenshot but you have to open the website and click the button for it to generate one and thus InetGet does not help.
      Any Ideas?
    • By naru
      Its Possible To auto Login with autoit script ?
    • By AnonymousX
      I need to pull data from company intranet website. I created a script that I can give a list of project numbers and it will open up the the related webpage for each project, save the html comments for that project, then move on to the next. 
      However my problem comes in that each time I open up a project it locks it for other users, and if you just exit the page it keeps it locked, you have to actually press the "close" button on the page. So I'm not sure how to deal with this as I end up just locking every project in my name when I run my program as I don't understand the nature of how the website is built. I don't understand how to close with just using my automation code without manually having to press the stupid button. 
      My Function:
      Func Getscript($ProjectAddress) ;getting the page source code and storing it into text file for easy reading it $file = FileOpen(@ScriptDir & "\source.txt", 10) $IE = _IECreate($ProjectAddress & ".html", 0, 0) $source = _IEDocReadHTML($IE) FileWrite($file, $source) $target_source = _StringBetween($source, "<BODY>", "</BODY>") ; only take content between the specified tags _IEQuit($IE) FileClose($file) return $target_source[0] EndFunc ;==>Getscript  
      Source Code I got from website that I think is relevant:
      function closeForm(){ if(topButtonEnabled("closeButton")){ parent.mainFrame.closeForm(); } } <button id="closeButton" class="saveCloseButton" style="LEFT: 77px;" onclick=closeForm()>&nbsp;Close&nbsp;</button>  
      Any Ideas of how to tell website to either activate the closeform function or just give it the command to close?
    • By Pintu
      Good evening guys,
      i'm having a problem, not about the code (i'm only thinking about it at the moment) but about the way i can do it.
      I have a webpage (photo N.1) it has some elements in it.
      I need only the table (photo N.2), looking at the code and with _IEFunctions i can easy find the table but how i can i "copy" it?
      As i said it's really easy to found with a script but what should i do then? Copy the source? And how can i display it to the user?
      In my head i'd like to display it inside a GUI, is that possible?
      Thanks in advance
      Edit: Posted 2 times same photo. Now should be OK


    • By perlabsrat
      I found a good drag and drop example here: https://www.autoitscript.com/forum/topic/28062-drop-multiple-files-on-any-control/
      I have been searching but not finding a way to do a variant of this example.
      I want to have a form with 2 or more list box controls on the form that have $GUI_DROPACCEPTED enabled. I then want to be able to drop separate groups of files on each list box  so that I have 2 separate list of dropped items that I can act upon independently rather than this example which only has one target.
      I have modified the example to add the 2nd list box but I am not sure how to determine which control hwnd got the drop event and then only add the files to that list box. In the current example both controls add the files to $hList1
      Apparently $hWnd  in WM_DROPFILES_FUNC() is not the control that triggers the event as I compared its value to the hwnd of each control.
      hwnd from $hList1 = 0x002F0BB8 hwnd from $hList2 = 0x003C06E0 hwnd from WM_DROPFILES_FUNC = 0x002F1180 hwnd from WM_DROPFILES_FUNC = 0x002F1180  
      Any ideas?

      ;Example from https://www.autoitscript.com/forum/topic/28062-drop-multiple-files-on-any-control/ #include <GUIConstants.au3> ;~ Global $WM_DROPFILES = 0x233 Global $gaDropFiles[1], $str = "" ### Koda GUI section start ### ;~ $hGUI = GUICreate("Test", 400, 200, 219, 178, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_TOPMOST)) ;~ $hList = GUICtrlCreateList("", 5, 5, 390, 190) ;~ GUICtrlSetState (-1, $GUI_DROPACCEPTED) Global $hGUI = GUICreate("Test", 573, 419, 219, 178, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) Global $hList1 = GUICtrlCreateList("", 5, 5, 390, 188) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSetData(-1, "List1") Global $hList2 = GUICtrlCreateList("", 42, 205, 390, 188) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSetData(-1, "List2") ConsoleWrite("hwnd from $hList1 = " & GUICtrlGetHandle($hList1) & @CRLF) ConsoleWrite("hwnd from $hList2 = " & GUICtrlGetHandle($hList2) & @CRLF) GUISetState(@SW_SHOW) ### Koda GUI section end ### GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $str = "" For $i = 0 To UBound($gaDropFiles) - 1 $str &= "|" & $gaDropFiles[$i] Next GUICtrlSetData($hList1, $str) EndSwitch WEnd Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam) ConsoleWrite("hwnd from WM_DROPFILES_FUNC = " & $hGUI & @CRLF) Local $nSize, $pFileName Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255) For $i = 0 To $nAmt[0] - 1 $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $nSize = $nSize[0] + 1 $pFileName = DllStructCreate("char[" & $nSize & "]") DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $nSize) ReDim $gaDropFiles[$i + 1] $gaDropFiles[$i] = DllStructGetData($pFileName, 1) $pFileName = 0 Next EndFunc ;==>WM_DROPFILES_FUNC  
  • Create New...