繁体   English   中英

拖放不适用于Selenium 3和Firefox驱动程序

[英]Drag and drop not working with selenium 3 and firefox driver

我正在使用java selenium webdriver

我面临的问题是拖放功能无法selenium 3firefox driver

我收到以下错误:

org.openqa.selenium.UnsupportedCommandException:POST / session / 92189939-94cc-4327-bfb0-72d66621d2f2 / moveto与已知命令不匹配Build info:version:'unknown',version:'1969d75',time:'2016-10 -18 09:43:45 -0700'系统信息:主机:'TADT063',ip:'192.168.0.195',os.name:'Windows 7',os.arch:'amd64',os.version:'6.1 ',java.version:'1.8.0_20'驱动程序信息:org.openqa.selenium.firefox.FirefoxDriver功能[{moz:profile = C:\\ Users \\ Amrutha.U \\ AppData \\ Local \\ Temp \\ rust_mozprofile.l2Myb7jgbekD,可旋转= false,超时= {implicit = 0,页面加载= 300000,脚本= 30000},pageLoadStrategy =正常,平台= ANY,specificationLevel = 0,moz:accessibilityChecks = false,acceptInsecureCerts = false,browserVersion = 52.0,platformVersion = 6.1, moz:processID = 4308,browserName = firefox,platformName = windows_nt}]会话ID:92189939-94cc-4327-bfb0-72d66621d2f2

有谁能够帮助我?

代码:

public void selectQuestions() throws InterruptedException, AWTException {

    Thread.sleep(3000);
    WebElement selectquestions = webElement("VAR_SELECTTOP5QUESTIONS");
    selectquestions.click();
    Thread.sleep(10000);
    Actions builder = new Actions(driver);
    Action drag = builder.clickAndHold(webElement("VAR_SELECTQUESTIONS")).build();
    drag.perform();
    Point coordinates = webElement("VAR_SELECTEDQUESTIONS").getLocation();
    Robot robot = new Robot();
    robot.mouseMove(coordinates.getX() + 280, coordinates.getY() + 120);
    Thread.sleep(3000);
    WebElement questions = webElement("VAR_SELECTEDQUESTIONS");
    questions.click();
    Thread.sleep(1000);
    WebElement questionNextButton = webElement("VAR_QUESTION_NEXTBUTTON");
    questionNextButton.click();
    Thread.sleep(1000);
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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