运行phantomjs时,Selenium测试失败

时间:2017-03-07 14:31:57

标签: selenium selenium-webdriver phantomjs nightwatch.js end-to-end

我使用nightwatch框架来运行端到端测试。我能够在chrome和IE中成功运行所有测试用例,但很少有测试用于phantomjs。测试用例出现以下错误

'Search' : function(browser) {

        browser
            .url('http://localhost:8001/index.html')

        browser
            .setValue('input[id=SearchInput-inner]', 'abc')
            .click('button[id=nsnButton]')
            .pause('1000')
            .verify.attributeEquals('#nsnButton', 'disabled', 'true')

    },

我得到的错误是

Testing if attribute disabled of <#nsnButton> equals "true". Element does not have a disabled attribute. - expected "true" but got: "null"

其他失败的测试是

.getCssProperty('#SearchInput-inner', 'border-color', function(result) {
                this.verify.equal(result.value, '#ee0000');
            })

我得到的错误是Failed [equal]: ('rgb(238, 0, 0)' == '#ee0000') - expected "#ee0000" but got: "rgb(238, 0, 0)"

如何处理这种情况,其中相同的测试适用于ie和chrome但是phantomjs失败。

由于

0 个答案:

没有答案
相关问题