gpt4 book ai didi

javascript - ProtractorJS 规范未运行,浏览器获取数据;仅有的

转载 作者:行者123 更新时间:2023-11-30 11:11:31 26 4
gpt4 key购买 nike

我运行我的 protractorjs conf.js,但浏览器地址只显示 data; 而从未运行我的 spec 文件。

文件夹结构和 conf.js Folder Structure & conf.js

规范.js spec.js

启动webdriver-manager Start webdriver-manager

运行 Protractor Run Protractor

浏览器 Browser

关闭浏览器时的错误结果 Error Result When Closed The Browser

这里是完整的错误信息:

johanessurya@BlackHat:/mnt/drive_e/vagrant/bsi (r-50)$ protractor protractorjs/conf.js
[14:44:47] I/launcher - Running 1 instances of WebDriver
[14:44:47] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[14:45:17] E/launcher - unknown error: Chrome failed to start: exited normally
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 4.15.0-33-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 29.49 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'BlackHat', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-33-generic', java.version: '10.0.2'
Driver info: driver.version: unknown
[14:45:17] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited normally
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 4.15.0-33-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 29.49 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'BlackHat', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-33-generic', java.version: '10.0.2'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
at Function.createSession (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
at createDriver (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/index.js:626:16)
at Hosted.getNewDriver (/home/johanessurya/.npm-global/lib/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
at Runner.createBrowser (/home/johanessurya/.npm-global/lib/node_modules/protractor/built/runner.js:195:43)
at q.then.then (/home/johanessurya/.npm-global/lib/node_modules/protractor/built/runner.js:339:29)
at _fulfilled (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/johanessurya/.npm-global/lib/node_modules/protractor/node_modules/q/q.js:796:13)
[14:45:17] E/launcher - Process exited with error code 199

我试着运行我以前运行正常的旧 Protractor 测试仪。当我尝试运行它时,结果是一样的。 也许我安装或设置了错误的版本

系统规范:

  • Ubuntu
  • NPM:3.5.2
  • 节点:8.10.0
  • Protractor :5.4.1
  • Jasmine v3.3.0
  • Jasmine 核心 v3.3.0
  • 网络驱动程序管理器:12.1.0

更新:我尝试使用 firefox 作为 browserName,它可以工作,但不能使用 chrome。好像是chromedriver的问题。这是我的 webdriver-manager config.json

{
"webdriverVersions": {
"selenium": "2.53.1",
"chromedriver": "2.27",
"geckodriver": "v0.13.0",
"iedriver": "2.53.1",
"androidsdk": "24.4.1",
"appium": "1.6.5"
},
"cdnUrls": {
"selenium": "https://selenium-release.storage.googleapis.com/",
"chromedriver": "https://chromedriver.storage.googleapis.com/",
"geckodriver": "https://github.com/mozilla/geckodriver/releases/download/",
"iedriver": "https://selenium-release.storage.googleapis.com/",
"androidsdk": "http://dl.google.com/android/"
}
}

最佳答案

您是否更新了您的驱动程序?webdriver-manager 更新

如果你需要通过代理使用这个命令

 webdriver-manager update --proxy=myProxyServer:Port

尝试将 conf 文件更改为下面的示例

// An example configuration file
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',

// Capabilities to be passed to the webdriver instance.
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--start-maximized' //in case of non headless execution
]
},

// Spec patterns are relative to the configuration file location passed
// to protractor (in this example conf.js).
// They may include glob patterns.
specs: ['example-spec.js'],

// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true, // Use colors in the command line report.
}
};

关于javascript - ProtractorJS 规范未运行,浏览器获取数据;仅有的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53442706/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com