jdi-testing / jdi-light

Powerful Framework for UI Automation Testing on Java
https://jdi-docs.github.io/jdi-light/
MIT License
109 stars 47 forks source link

Error after using dragAndDropTo function #2227

Open markovaka opened 4 years ago

markovaka commented 4 years ago

I use function dragAndDropTo for jdi 1.2.14 and i see error Failed actions chain: UIElement.dragAndDropTo(WebElement:'BucketDetailsPage.productsInFolderContainer (css='.products')') java.lang.RuntimeException: [43:58.79] Failed to execute 'dragAndDropTo' for element 'Search Result Shareable Products[2]' during '20' seconds. java.lang.ClassCastException: com.epam.jdi.light.elements.common.UIElement cannot be cast to org.openqa.selenium.interactions.Locatable

for example productElement.dragAndDropTo(productsInFolderContainer);

AlexSofft commented 4 years ago

Looks like it's a common issue for all custom selenium elements. https://github.com/SeleniumHQ/selenium/issues/5346 The possible solution is not to use UI elements and annotations. You can use common Selenium methods: WebDriver driver =WebDriverFactory.getDriver(); WebElement from = driver.findElement(By.xpath("//li[contains(@class, 'item2')]")); WebElement to = driver.findElement(By.xpath("//li[contains(@class, 'item3')]")); builder.clickAndHold(from).moveToElement(to,5,5).release(to).build().perform();