无法在量角器中执行脚本

时间:2015-10-30 06:21:33

标签: javascript jasmine protractor

我的代码:

describe('Candidate profile view',function() {

    it('While downloading a resume', function () {

        browser.sleep(5000);
        element(by.css('span.icon-briefcase')).click();
        browser.sleep(5000);
        element.all(by.css('strong.ng-binding.center-block.setcardview')).filter(function (strong, index) {
            return index == 0;
        }).each(function (strong) {
            strong.click();
        });


        element.all(by.css('span.badge.ng-binding')).filter(function (span, index) {
            return index == 0;
        }).each(function (span) {
            span.click();
            browser.sleep(5000);
        });
    });

    it('Clicking on status icon', function() {

        element(by.css('i.flaticon-leftarrow48')).click();
        browser.sleep(5000);
        browser.executeScript('window.scrollTo(0,250);');
        browser.sleep(2000);
        element(by.partialButtonText('Initial Status')).click();
        browser.sleep(2000);

    });


    it('Choosing the status:', function() {

        var screen = element.all(by.css('[ng-click="setStatus(choice, member)"]')).get(1);
        screen.click();
        element(by.css('button.btn.btn-main.btn-sm')).click();
         browser.sleep(5000);
        browser.executeScript('window.scrollTo(250,0);');
        browser.sleep(5000);

    });

    it('Clicking on screened button', function() {
        element(by.cssContainingText('.ng-binding', 'Screened')).click();
        browser.sleep(5000);
    });

    it('Clicking on candidate name', function() {

        element(by.css('.user-title')).click();
        browser.sleep(10000);
    });

    browser.getAllWindowHandles().then(function(handles){
        browser.switchTo().window(handles[1]).then(function(){
            var elem = element(by.partialLinkText("RESUME"));
            browser.wait(protractor.ExpectedConditions.elementToBeClickable(elem), 10000).then(function(){
                elem.click();
                browser.sleep(5000);
                element(by.css('i.glyphicon.glyphicon-download-alt')).click();
                browser.sleep(5000);

            });
        });
    });
});

我收到此错误:

var template = new Error(this.message);
                 ^
UnknownError: null value in entry: name=null
    at new bot.Error (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
    at Object.bot.response.checkResponse (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
    at /home/raghavendra/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:377:20
    at [object Object].promise.ControlFlow.runInFrame_ (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1877:20)
    at [object Object].promise.Callback_.goog.defineClass.notify (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:2464:25)
    at [object Object].promise.Promise.notify_ (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:563:12)
    at Array.forEach (native)
    at Object.goog.array.forEach (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/goog/array/array.js:203:43)
    at [object Object].promise.Promise.notifyAll_ (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:552:16)
    at goog.async.run.processWorkQueue (/home/raghavendra/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:125:21)
[launcher] Process exited with error code 1

问题:

如果我删除所有阻止(除了一个),那么这段代码工作正常。 我到处都在睡觉,这是一个问题。

使用量角器我面临这些问题。

0 个答案:

没有答案