dragAndDropTo macro complete but nothing happens

Hi, I have a problem with the drag & drop command.
I want to add a song to a playlist with the command dragAndDropTo.
If I run my macro on Spotify, Kantu tells me that it has executed all the commands correctly, but the song is not added to the playlist. I can’t understand the reason and why there are no errors in the logs window.

{
  "Name": "Drag&drop",
  "CreationDate": "2019-11-27",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://accounts.spotify.com/it/login?continue=https:%2F%2Fopen.spotify.com%2F",
      "Value": ""
    },
    {
      "Command": "clickAndWait",
      "Target": "link=Accedi con Facebook",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"main\"]/div/div[4]/div[1]/nav/div[2]/div/div/div/button/span",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"main\"]/div/div[4]/div[1]/nav/div[2]/div/div/div/button/span",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"main\"]/div/div[5]/div/div[1]/div/div/input",
      "Value": "Plist"
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"main\"]/div/div[5]/div/div[2]/div[2]/button",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"main\"]/div/div[4]/div[1]/nav/ul/li[2]/div/a/div/span",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"searchPage\"]/div/div[1]/label/input",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"searchPage\"]/div/div[1]/label/input",
      "Value": "Ace of Spades"
    },
    {
      "Command": "dragAndDropToObject",
      "Target": "xpath=//*[@id=\"searchPage\"]/div/div[2]/section[1]/div/div[2]/div/div",
      "Value": "link=Plist"
    }
  ]
}

It has ever happened to anyone? Can anyone help me?
Thanx :grinning:

The native Selenium IDE drag and drop commands fail often if the page is more complex. What I use as solution is to do drag and drop with the XMove command:

  • XMove (old position)
  • XMove (old position) | #down
  • XMove (new position)
  • XMove (new position) | #up

This is slower, but it works with all kinds of pages. It works similar to the canvas drawing demo in DemoXClick.

1 Like

Thank you very much Plankton, with xMove everything works very well now!