@ When ( "^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$" ) public void seleniumDrag ( String smethod , String source , String dmethod , String destination ) throws ClassNotFoundException , NoSuchFieldException , SecurityException , IllegalArgumentException , IllegalAccessException { Actions builder = new Actions ( commonspec . getDriver ( ) ) ; List < WebElement > sourceElement = commonspec . locateElement ( smethod , source , 1 ) ; List < WebElement > destinationElement = commonspec . locateElement ( dmethod , destination , 1 ) ; builder . dragAndDrop ( sourceElement . get ( 0 ) , destinationElement . get ( 0 ) ) . perform ( ) ; }
Searchs for two webelements dragging the first one to the second