Action.perform() UnsupportedOperationException

107 views
Skip to first unread message

Zihao Yu

unread,
Mar 8, 2011, 11:02:47 AM3/8/11
to webd...@googlegroups.com
Hi all. I'm trying to use DefaultActionChainsGenerator class to perform a series of operations:

ActionChainsGenerator generator = new DefaultActionChainsGenerator(driver);
generator.keyDown(Keys.CONTROL);
for (WebElement e: elements) {
    generator.click(e);
}
generator.keyUp(Keys.CONTROL);
Action action = generator.build();
action.perform();


Basically I am trying to select multiple elements by holding down CTRL and clicking each of them. I got the following exception:

java.lang.UnsupportedOperationException: Unrecognized command: POST /session/00f1f3e8-027a-4974-877e-00f529945383/modifier
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:410)
org.openqa.selenium.remote.RemoteWebDriver$RemoteKeyboard.pressKey(RemoteWebDriver.java:621)
org.openqa.selenium.interactions.KeyDownAction.perform(KeyDownAction.java:40)
org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:31)

Any suggestion would be appreciated.
-- 
Zihao

Rostislav Matl

unread,
Mar 14, 2011, 7:51:36 AM3/14/11
to webdriver
I have the same problem, Selenium 2.0b2 and following code,
is it supposed to work ?

Keyboard keyboard = ((HasInputDevices) driver).getKeyboard();
keyboard.pressKey(Keys.SHIFT);
List<WebElement> selectOptions =
selectElement.findElements(By.tagName("option"));
selectOptions.get(1).click();
selectOptions.get(3).click();
keyboard.releaseKey(Keys.SHIFT)

On 8 bře, 17:02, Zihao Yu <zihao...@gmail.com> wrote:
> Hi all. I'm trying to use DefaultActionChainsGenerator class to perform
> a series of operations:
>
> ActionChainsGenerator generator = new DefaultActionChainsGenerator(driver);
> generator.keyDown(Keys.CONTROL);
> for (WebElement e: elements) {
>      generator.click(e);}
>
> generator.keyUp(Keys.CONTROL);
> Action action = generator.build();
> action.perform();
>
> Basically I am trying to select multiple elements by holding down CTRL
> and clicking each of them. I got the following exception:
>
> *java.lang.UnsupportedOperationException: Unrecognized command: POST
> /session/00f1f3e8-027a-4974-877e-00f529945383/modifier*

QA_manager

unread,
Mar 14, 2011, 8:50:50 AM3/14/11
to webdriver
What OS and version are you using?
What browser and version are you using?

Harry

unread,
Mar 14, 2011, 10:53:45 AM3/14/11
to webdriver
I have the same problem with Selenium 2.0b2 downloaded yesterday (Mar
13, 2011).
The code:
FirefoxDirver driver = new FirefoxDriver();
driver.get("http://localhost:8080/portal");
WebElement icon = driver.findElement(By.xpath("//img[@id=vm]"));
icon.click(); // no problem
MoveToOffsetAction hover = new
MoveToOffsetAction(driver.getMouse(), (RemoteWebElement)icon, 0, 0)
hover.perform(); // throws UnsupportedOperationException,
moveTo is not supported

OS: Windows XP SP3
Browser: Firefox 3.6.15

Rostislav Matl

unread,
Mar 15, 2011, 8:27:30 AM3/15/11
to webdriver
I'm running Selenium 2.0b2 on MS Windows 7 Professional, Firefox
3.6.15.
I'll provide any further info if it helps.

zihao

unread,
Mar 15, 2011, 10:32:12 AM3/15/11
to webdriver
I'm running Selenium 2.0b2 on Windows 7 64-bit home premium with FF
3.6.9
> > > > org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.ja va:31)

Rostislav Matl

unread,
Mar 22, 2011, 11:31:07 AM3/22/11
to webdriver
Still affected - Selenium 2.0b3 on MS Windows 7 Professional, Firefox
3.6.15.

On 14 bře, 13:50, QA_manager <no_cats2...@yahoo.com> wrote:

Rostislav Matl

unread,
Mar 30, 2011, 8:19:35 AM3/30/11
to webdriver
I reported two issues - one for Keyboard, one for Mouse:

http://code.google.com/p/selenium/issues/detail?id=1427
http://code.google.com/p/selenium/issues/detail?id=1386

What else I can do ?

Simon Stewart

unread,
Mar 30, 2011, 9:22:15 PM3/30/11
to webd...@googlegroups.com
We'll get to it when we can :)

Simon

> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages