Иногда перетаскивание не работает с элементом HTML 5 с использованием API транспортира.Альтернативой является использование функции j Query или java script:
Идентифицируйте исходный и целевой элемент с помощью соответствующих локаторов и перейдите к функции ниже.
async PerformDragAndDrop(source: ElementFinder, target: ElementFinder){
browser.executeScript("function createEvent(typeOfEvent) {\n" +
"var event = document.createEvent('CustomEvent');\n" +
"event.initCustomEvent(typeOfEvent, true, true, null);\n" +
" event.dataTransfer = {\n" +
" data: {},\n" +
" setData: function (key, value) {\n" +
" this.data[key] = value;\n" +
" },\n" +
" getData: function (key) {\n" +
" return this.data[key];\n" +
" }\n" +
" };\n" +
" return event;\n" +
"}\n" +
"\n" +
"function dispatchEvent(element, event, transferData) {\n" +
" if (transferData !== undefined) {\n" +
" event.dataTransfer = transferData;\n" +
" }\n" +
" if (element.dispatchEvent) {\n" +
" element.dispatchEvent(event);\n" +
" } else if (element.fireEvent) {\n" +
" element.fireEvent('on' + event.type,event);\n" +
" }\n" +
"}\n" +
"\n" +
"function simulateHTML5DragAndDrop(element, target) {\n"
" var dragStartEvent =createEvent('dragstart');\n" +
" dispatchEvent(element, dragStartEvent);\n" +
" var dropEvent = createEvent('drop');\n" +
" dispatchEvent(target, dropEvent,dragStartEvent.dataTransfer);\n" +
" var dragEndEvent = createEvent('dragend'); \n" +
" dispatchEvent(element, dragEndEvent,dropEvent.dataTransfer);\n" +
"}\n" +
"\n" +
"var source = arguments[0];\n" +
"var target = arguments[1];\n" +
"simulateHTML5DragAndDrop(source,target);", source, target);
}