RE: Mouse over not working

Hi

I am using selenium3.3 and gecko.15 and when i am trying to do a mouseover ¬†on a menu .it is failing with “moveto did not match a known command”

 

package NewPackage;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

public class TestActionfunction {

public static void main(String[] args) {
// TODO Auto-generated method stub

System.setProperty(“webdriver.gecko.driver”, “P:\\plugin\\gecko15\\geckodriver.exe”);
try
{
WebDriver driver= new FirefoxDriver();
// driver.manage().window().maximize();
driver.get(“http://www.store.demoqa.com”);
Actions actions= new Actions(driver);
WebElement menu =driver.findElement(By.xpath(“.//*[@id=’menu-item-33′]”));
actions.moveToElement(menu).build().perform();
actions.moveToElement(driver.findElement(By.xpath(“.//*[@id=’menu-item-33′]/ul/li[3]/span/a”))).click().build().perform();

}
catch(Exception e)
{
e.printStackTrace();
}
}

}

RESPONSE

1490059166051 geckodriver INFO Listening on 127.0.0.1:31012
Mar 21, 2017 11:49:26 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
1490059166651 mozprofile::profile INFO Using profile path C:\Users\hslngh\AppData\Local\Temp\rust_mozprofile.FUJYXvQOKza2
1490059166734 geckodriver::marionette INFO Starting browser C:\Program Files\Mozilla Firefox\firefox.exe
1490059166752 geckodriver::marionette INFO Connecting to Marionette on localhost:55002
1490059167299 Marionette INFO Listening on port 55002
Mar 21, 2017 11:49:28 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
org.openqa.selenium.UnsupportedCommandException: POST /session/e7ca4d22-510b-4038-94dd-477d7266ea06/moveto did not match a known command
Build info: version: ‘unknown’, revision: ‘1969d75’, time: ‘2016-10-18 09:43:45 -0700’
System info: host: ‘HSL-PC0183’, ip: ‘192.168.220.48’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_112’
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\hslngh\AppData\Local\Temp\rust_mozprofile.FUJYXvQOKza2, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0.1, platformVersion=10.0, moz:processID=256680, browserName=firefox, platformName=windows_nt}]
Session ID: e7ca4d22-510b-4038-94dd-477d7266ea06
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35)
at org.openqa.selenium.remote.RemoteMouse.mouseMove(RemoteMouse.java:89)
at org.openqa.selenium.interactions.MoveMouseAction.perform(MoveMouseAction.java:39)
at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:50)
at NewPackage.TestActionfunction.main(TestActionfunction.java:31)

 

NG2017 Default Asked on March 21, 2017 in Selenium WebDriver.
Add Comment
1 Answers

It’s a versioning problem. Selenium 3 has no support yet for Actions class driver. You will have to download to a lower version. Version 2.53.1 works fine for me with Firefox

 

Train Answered on March 28, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.