How do I use Selenium WebDriver simulation to drag and drop page elements into the input box?

in commonly used browsers, (Chrome, Firefox and IE), drag page elements to the input box (< input type= "text" / >);
  • if the element being dragged is a picture (), the href attribute value of the picture is automatically populated in the input box;
  • if the element being dragged is text (< span/ >, < p / >.),), the contents of the text are automatically populated into the input box.

however, the above function cannot be achieved by calling the relevant API, of WebDriver to simulate the above behavior.

related codes

    Actions builder = new Actions(driver);
    
    //use dragAndDrop
    builder.dragAndDrop(source, target).perform();
    
    //use moveToElement,clickAndHold,release
    builder.moveToElement(source, 10, 10).clickAndHold(source);
    builder.moveToElement(target, 10, 10).release(source).perform();
    

none of the above methods can achieve automatic filling, how to use WebDriver simulation to drag and drop page elements to the input box?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be8358-318eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be8358-318eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?