拖放不使用selenium 3和firefox驱动程序

时间:2017-02-13 08:25:54

标签: java selenium firefox selenium-webdriver

我正与selenium webdriver合作java

我遇到的问题是拖放无效selenium 3firefox driver

我收到以下错误:

  

org.openqa.selenium.UnsupportedCommandException:POST / session / 92189939-94cc-4327-bfb0-72d66621d2f2 / moveto与已知命令不匹配   建立信息:版本:'未知',修订版:' 1969d75',时间:' 2016-10-18 09:43:45 -0700'   系统信息:主机:' TADT063',ip:' 192.168.0.195&​​#39;,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,rotate = false,timeouts = {implicit = 0,page load = 300000,script = 30000},pageLoadStrategy = normal ,platform = 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);
}

0 个答案:

没有答案