java.lang.IllegalArgumentException: You may not use new style interactions with old style actions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.IllegalArgumentException: You may not use new style interactions with old style actions

sgaru
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.html

but 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
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: You may not use new style interactions with old style actions

softwaretestingforum
Administrator
Please post your webdrier question here - http://www.seleniumtests.com/p/selenium-2-forum.html
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: You may not use new style interactions with old style actions

sgaru
In reply to this post by sgaru
I posted my query on that forum but it is not enlisted.

Can you please check if i have access to that forum also

Thanks,
Sankalpa
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: You may not use new style interactions with old style actions

softwaretestingforum
Administrator
you should be as just gmail id is required for forum.
given the huger number of posts, moderators need time to sort posts
~ seleniumtests.com