webdriver-io v7测试如何与内部网Selenium网格一起运行?根据公司政策,intranet Selenium Grid是唯一的选项吗?我可以在Webdriverio服务中找到独立的Selenium、chrome驱动程序和一些云服务,但不能找到公司内部Selenium Grid实例
发布于 2021-10-06 22:46:51
甚至我也面临着同样的问题。下面的步骤帮了我大忙了!
> hostname: 'selenium.company.internal',
> port: <number>,
> path: '/wd/hub/',
> protocol: 'https',将上述值添加到wdio.conf.js文件中。
wdio-chromedriver-service依赖项。npm i或npm run test测试(在我的示例中为npm run test)轰隆隆!测试执行将在网格中启动。
发布于 2021-05-20 22:57:27
不需要额外的webdriverio服务,比如Selenium独立服务或ChromDriver服务。需要正确的wdio.conf.js或wdio.conf.ts。重要字段包括主机名、端口、路径、协议和功能。
export const config: WebdriverIO.Config = {
//
// ====================
// Runner Configuration
// ====================
//
// WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
// on a remote machine).
runner: 'local',
//
// =====================
// Server Configurations
// =====================
// Host address of the running Selenium server. This information is usually obsolete as
// WebdriverIO automatically connects to localhost. Also, if you are using one of the
// supported cloud services like Sauce Labs, Browserstack, Testing Bot or LambdaTest you don't
// need to define host and port information because WebdriverIO can figure that out
// according to your user and key information. However, if you are using a private Selenium
// backend you should define the host address, port, and path here.
//
hostname: 'selenium.company.internal',
port: <number>,
path: '/wd/hub/',
protocol: 'https',.
功能:[{
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
// grid with only 5 firefox instances available you can make sure that not more than
// 5 instances get started at a time.
'maxInstances': 5,
'browserName': 'chrome',
'acceptInsecureCerts': true,
// If outputDir is provided WebdriverIO can capture driver session logs
// it is possible to configure which logTypes to include/exclude.
// excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs
// excludeDriverLogs: ['bugreport', 'server'],
'goog:chromeOptions': {
'args': [
// Runs Chrome in headless mode.
"--headless",
// Temporarily needed if running on Windows.
"--disable-gpu",
"--window-size=2000,1024",
// dont show the 'this browser is controlled by software' bar
"--disable-infobars"
]
}
}],发布于 2022-02-11 17:18:25
在配置文件中更改此设置。在网格中运行时
services: [],
hostname: your.domain.without.http.and.without.port,
port: 4444,
path: '/wd/hub/',
protocol: 'http',当在本地运行时
services: ['chromedriver'],在本地运行中,主机名、端口、路径和协议可以是任何值,也可以删除,因为框架不会选取此值。依赖项"wdio-chromedriver-service“需要安装,因为它是本地运行所必需的。
https://stackoverflow.com/questions/67573547
复制相似问题