首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Webdriverio v7 remote selenium网格

Webdriverio v7 remote selenium网格
EN

Stack Overflow用户
提问于 2021-05-18 00:21:38
回答 3查看 627关注 0票数 0

webdriver-io v7测试如何与内部网Selenium网格一起运行?根据公司政策,intranet Selenium Grid是唯一的选项吗?我可以在Webdriverio服务中找到独立的Selenium、chrome驱动程序和一些云服务,但不能找到公司内部Selenium Grid实例

EN

回答 3

Stack Overflow用户

发布于 2021-10-06 22:46:51

甚至我也面临着同样的问题。下面的步骤帮了我大忙了!

代码语言:javascript
复制
>  hostname: 'selenium.company.internal',
>     port: <number>,
>     path: '/wd/hub/',
>     protocol: 'https',

将上述值添加到wdio.conf.js文件中。

  • 删除package.json文件中的wdio-chromedriver-service依赖项。
  • 执行npm inpm run test测试(在我的示例中为npm run test)

轰隆隆!测试执行将在网格中启动。

票数 1
EN

Stack Overflow用户

发布于 2021-05-20 22:57:27

不需要额外的webdriverio服务,比如Selenium独立服务或ChromDriver服务。需要正确的wdio.conf.js或wdio.conf.ts。重要字段包括主机名、端口、路径、协议和功能。

代码语言:javascript
复制
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',

.

功能:[{

代码语言:javascript
复制
    // 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"
        ]
    }
}],
票数 0
EN

Stack Overflow用户

发布于 2022-02-11 17:18:25

在配置文件中更改此设置。在网格中运行时

代码语言:javascript
复制
services: [],
hostname: your.domain.without.http.and.without.port,
port: 4444,
path: '/wd/hub/',
protocol: 'http',

当在本地运行时

代码语言:javascript
复制
services:  ['chromedriver'],

在本地运行中,主机名、端口、路径和协议可以是任何值,也可以删除,因为框架不会选取此值。依赖项"wdio-chromedriver-service“需要安装,因为它是本地运行所必需的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67573547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档