Following is HTML for source element:
<div title="" class="dragItem row " id="DocSelected-1" draggable="true" type="11" data-content="Salary Slips" data-draggable="item" document-required="1" state="notVerified" accountid="0">
<span class="col-xs-10 dl-no-padding">
<span>Salary Slips</span>
</span>
and following is HTML for target element:
<div class="removeDocs" data-draggable="remove"> Drag here to remove document </div>
Below is the code tried to achieve the drag and drop,
IWebElement from = driver.FindElement(By.XPath("//div[@id='DocSelected-1']//span[@class='col-xs-10 dl-no-padding']"));
IWebElement to = driver.FindElement(By.ClassName("removeDocs"));
Actions act = new Actions(driver);
act.DragAndDrop(from, to).Build().Perform();
When i tried with the above code, the test case got passed but drag and drop is not done.
So kindly suggest the right way to perform drag and drop operation.
Aucun commentaire:
Enregistrer un commentaire