Skip to content

Instantly share code, notes, and snippets.

@ederign
Created December 17, 2014 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ederign/e3bd5b9585817b8e5ed6 to your computer and use it in GitHub Desktop.
Save ederign/e3bd5b9585817b8e5ed6 to your computer and use it in GitHub Desktop.
import java.io.IOException;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test {
public static void main( String[] args ) throws IOException {
WebDriver driver = null;
try {
driver = new FirefoxDriver();
driver.navigate().to( "http://localhost:8080/kie/" );
//dnd 6x6 grid inside a column
String dnd1 = "jQuery('#a').simulateDragDrop({ dropTarget: '#b'});";
//put html component in left
String dnd2 = "$('#c').simulateDragDrop({ dropTarget: '#d'});";
//put dashbuilder component in right
String dnd3 = "$('#e').simulateDragDrop({ dropTarget: '#f'});";
try{
final Object o = ( (JavascriptExecutor) driver )
.executeScript( dnd1 );
}
catch ( Exception e ){
System.out.println();
}
try{
final Object o = ( (JavascriptExecutor) driver )
.executeScript( dnd2 );
}
catch ( Exception e ){
System.out.println();
}
try{
final Object o = ( (JavascriptExecutor) driver )
.executeScript( dnd3 );
}
catch ( Exception e ){
System.out.println();
}
} finally {
driver.close();
driver.quit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment