Is there any examples of Javascript or jQuery been used with Selenium Webdriver Java
? I'm having issues with drag and drop using selenium. I'm hoping to use the following code with Javascript/jQuery to perform a drag and drop. I cannot use point and click in my test scripts to perform drag and drop so I'm hoping to use jQuery or java script to perform the drag and drop. I'm having trouble integrating the two. I only want suggestion for drag and drop using javascript or an example of javascript (any) and selenium webdriver code in the same script
public void test(){
driver.findElement(By.id("addService")).click();
driver.findElement(By.id("name")).sendKeys(name);
driver.findElement(By.id("identifier")).sendKeys(id);
driver.findElement(By.id("flowStatus")).clear();
driver.findElement(By.id("flowStatus")).sendKeys(flow);
}
public void dragAndDropElement(WebElement dragFrom, WebElement dragTo) throws Exception {
Actions actions = new Actions(driver);
actions.clickAndHold(dragFrom).release(dragTo).build().perform();;
}
public void test() throws Exception {
WebElement dragFrom = driver.findElement(By.xpath("/html/body/div/div[2]/div[1]/form/fieldset/table[1]/tbody/tr/td[1]/div/div[1]"));
WebElement dragTo = driver.findElement(By.id("drop"));
dragAndDropElement(dragFrom,dragTo);
}