CFSelenium在执行CLICK命令时中断

时间:2014-09-05 16:28:44

标签: coldfusion selenium-rc

我正在使用CFSELENIUM和MXUNIT创建测试用例。运行时,在此处执行CLICK命令时失败:

selenium.click("//button[@id='Submit']");

它会抛出以下错误消息。

  

应用:Selenium RC的响应无效:错误:   命令执行失败。请搜索用户组   https://groups.google.com/forum/#!forum/selenium-users表示错误   日志窗口中的详细信息。错误消息是:参数1   EventTarget.dispatchEvent不实现接口事件。

请在下面找到代码。

component extends="cfselenium.CFSeleniumTestCase" displayName="seleniumBase" {

    public void function beforeTests() {

        //your local host
        variables.browserUrl = "url";
        variables.browserCommand = "*firefox";

        super.beforeTests();
        selenium.setTimeout(50000);
        selenium.setSpeed( 500 );
    }

    public void function afterTests() {
        super.afterTests();
    }

    private void function logIn(){
        selenium.open(variables.browserUrl);
        selenium.waitForPageToLoad("30000");

        //your username
        variables.backofficeUserName = "test";
        selenium.type("id=UserName", variables.backofficeUserName);

        //your password
        variables.backofficePassword = "test";
        selenium.type("//input[@type = 'password']", variables.backofficePassword);

        selenium.click("//button[@id='Submit']");
        selenium.waitForPageToLoad("30000");
    }
}

2 个答案:

答案 0 :(得分:0)

嗯..在发布之前,您是否按照错误消息中的建议进行搜索或查看CFSelinium project? ; - )

一个非常简短的搜索出现了几个线程,表明它是在Selinum的更高版本中解决的问题,例如2.42.2。

CFSelinium项目还列出了一个错误修复,听起来很像你的问题..

答案 1 :(得分:0)

它可能适用于所有浏览器......试试吧......

selenium.click("//input[@id='Submit']");
相关问题