Hi,
I am using a local html page selectable.html to be launced by web driver.
the code that i am passing is as below
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
public class Interactions {
public static void main(String... args) {
System.setProperty("webdriver.gecko.driver", "E:\\Selenium\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("file://E:/selectable.html");
WebElement one = driver.findElement(By.name("one"));
WebElement three = driver.findElement(By.name("three"));
WebElement five = driver.findElement(By.name("five"));
// Add all the actions into the Actions builder.
Actions builder = new Actions(driver);
builder.keyDown(Keys.CONTROL).click(one).click(three).click(five)
.keyUp(Keys.CONTROL);
// Generate the composite action.
//Action compositeAction = builder.build();
// Perform the composite action.
builder.perform();
}
}
The html page is attached
Selectable.htmlbut on executing this code i am getting the error mentioned in Subject line
java.lang.IllegalArgumentException: You may not use new style interactions with old style actions
I am using java selenium 3.3.0
Also i have added the standalone jar for java selenium server 3.3 to project.
I checked online and found reference to this only on
https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/interactions/Actions.java