简体   繁体   中英

How to Right click on element and save as text file in mozilla firefox using selenium in JAVA

I tried this code but it throwing Exception...

Exception in thread "main" org.openqa.selenium.UnsupportedCommandException: POST /session/35794864-fb23-4bcc-bbb2-d474936e6742/moveto did not match a known command (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 9 milliseconds

This is my code:

//temp is my webelement

action.moveToElement(temp); 
action.contextClick(temp).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();

Please try this...

you have written code to move to element but, you didn't build and perform.

action.moveToElement(temp).build().perform();

action.contextClick(temp).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.ENTER).build().perform();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM