gpt4 book ai didi

selenium-webdriver - session 未在 Protractor 中为 chrome 创建异常

转载 作者:搜寻专家 更新时间:2023-10-30 20:33:53 25 4
gpt4 key购买 nike

尝试针对 chrome 运行 Protractor 测试时出现以下错误。

我的conf.ts

import {Config} from 'protractor'

export let config: Config = {
framework: 'jasmine',
// capabilities: { browserName: 'chrome'},
multiCapabilities: [
// {browserName: 'firefox'},
{
browserName: 'chrome',
chromeOptions: {
args: ['--start-maximized']
},

}],

seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
seleniumPort: null,
seleniumArgs: [],
specs: [
'./Protractor/Login/*.spec.js',

错误:

Protractor conf.js
[17:19:07] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[17:19:07] I/launcher - Running 1 instances of WebDriver
[17:19:09] E/launcher - session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"8800.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.59)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.07 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'MAL000009416062', ip: '192.168.1.4', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_73'
Driver info: org.openqa.selenium.chrome.ChromeDriver
[17:19:09] E/launcher - SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"8800.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.59)
(Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.07 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'MAL000009416062', ip: '192.168.1.4', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_73'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at WebDriverError (C:\Users\392811\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:27:5)
at SessionNotCreatedError (C:\Users\392811\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:308:5)

conf.ts

multiCapabilities: [

{
browserName: 'chrome',
chromeOptions: {
args: ['--start-maximized']
},

}],

网络上的大部分讨论都是围绕版本展开的。我目前使用的是最新版本

有什么线索吗?

干杯

最佳答案

您可以通过更改 Protractor 的 config.json 文件来更改 webdriver-manager 下载的 chromedriver 的版本...

  1. 编辑 Protractor 的配置文件:node_modules/protractor/config.json
  2. 将 Chrome 驱动程序版本更改为您需要的任何版本。例如。 “chromedriver”:“2.24”。
  3. 运行 webdriver-manager 更新。

根据您发布的错误,protractor 未使用最新的 chrome 驱动程序版本。在堆栈跟踪中,它显示 chrome 驱动程序版本为 2.21

关于selenium-webdriver - session 未在 Protractor 中为 chrome 创建异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40100960/

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