量角器:尽管使用了browser.pause()

时间:2018-03-19 09:50:32

标签: browser protractor pause

我有这样的代码:

    describe('test room example', function() {

        it("test", function(){
            browser.ignoreSynchronization = true;
            browser.get("url");

            element(by.id("#id")).click();

            var EC = protractor.ExpectedConditions;
            var cashboxnumber=EC.visibilityOf(element(by.id("#id")));
            var beginningCash=EC.visibilityOf(element(by.id("#id")));
            var btnSignOn=EC.visibilityOf(element(by.id("#id")));
            browser.wait(EC.and(cashboxnumber, beginningCash, btnSignOn), 155000);
            element(by.id("#id")).sendKeys("9999");
            element(by.id("#id")).click();
            element(by.id("#id")).click();

            var transactionIDSearch=EC.visibilityOf(element(by.id("#id")));
            var searchIcon=EC.visibilityOf(element(by.id("#id")));
            browser.wait(EC.and(transactionIDSearch, searchIcon), 155000);
            element(by.id("#id")).sendKeys("X");
            element(by.id("#id")).click();
            browser.pause();
        }) 

    });

我希望浏览器在执行完成后不要关闭。但它关闭了,结果我收到了以下错误:

[15:15:25] I/launcher - Running 1 instances of WebDriver
[15:15:25] I/hosted - Using the selenium server at http://localhost:4444/wd/hub/
Started
[15:17:20] I/protractor -
[15:17:20] I/protractor - Encountered browser.pause(). Attaching debugger...
[15:17:20] I/protractor -
[15:17:20] I/protractor - ------- WebDriver Debugger -------
[15:17:20] I/protractor - Starting WebDriver debugger in a child process. Pause is still beta, please report issues at github.com/angular/protractor
[15:17:20] I/protractor -
[15:17:20] I/protractor - press c to continue to the next webdriver command
[15:17:20] I/protractor - press ^D to detach debugger and resume code execution
[15:17:20] I/protractor -
module.js:540
    throw err;
    ^

Error: Cannot find module '_debugger'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\e3024747\workspace\jsproject\protractor\built\debugger\debuggerCommons.js:1:82)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
[32m.[0m


1 spec, 0 failures
Finished in 112.262 seconds

[15:17:20] I/launcher - 0 instance(s) of WebDriver still running
[15:17:20] I/launcher - chrome #01 passed

任何人都可以建议我在这里做错了什么。我已经读过使用browser.pause()在执行完成后不会使浏览器关闭。

我是量角器的新手,无法找到解决方法来实现这一目标。

1 个答案:

答案 0 :(得分:1)

我假设您正在使用节点8?我认为他们不支持此版本的调试器。尝试将节点降级到7.0版。