我怎样才能完全避免 webdriver-manager? [英] How can I completely avoid webdriver-manager?

查看:47
本文介绍了我怎样才能完全避免 webdriver-manager?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Angular 项目中使用量角器进行 e2e 测试.我之前在我的路径中安装了 selenium 服务器和 chromedriver,它适用于非角度项目.我无权访问 googleapis 或 webdriver-manager 所需的任何备用 CDN.

I'm trying to use protractor for e2e tests in my Angular project. I previously installed selenium server and chromedriver in my path and it works fine for non-angular projects. I do not have access to googleapis or any of the alternate cdns required by webdriver-manager.

如何以任何方式运行没有涉及 webdriver-manager 的量角器测试?我想使用我在全局安装的工具.有这种可能吗?

How can I run protractor tests w/o involving webdriver-manager in any way? I want to use the tools I have installed globally. Is this a possibility?

当我尝试运行 ng e2e 时出现错误:错误消息:找不到 update-config.json.运行webdriver-manager update"以下载二进制文件.

When I try to run the ng e2e I get the error: Error message: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.

当我尝试运行 webdriver-manager update 时,我得到一个 http 403.

When I try to run webdriver-manager update I get an http 403.

在我的 protractor.conf.js 文件中,我有 directConnect: true 和 capabilities.browserName: 'chrome'

In my protractor.conf.js file I have directConnect: true and capabilities.browserName: 'chrome'

我希望通过使用 directConnect,它只会在我的路径中找到 chromedriver,但事实并非如此.过去我会使用 selenium-webdriver npm 模块来启动 chrome 驱动程序的实例.

I was hoping that by using directConnect it would just find the chromedriver in my path but that isn't the case. In the past I would use the selenium-webdriver npm module to spin-up an instance of chrome driver.

推荐答案

下载最新的 selenium 独立服务器和 chromedriverhttps://www.seleniumhq.org/download/

创建批处理文件

java -Dselenium.LOGGER.level=WARNING -Dwebdriver.chrome.driver="C:/Program Files (x86)/Selenium/WebDrivers/ChromeDrivers/2.38/chromedriver.exe" -jar selenium-server-standalone-3.4.0.jar -port 4444

指定端口、Chromedriver 位置和日志级别.

specify the port,Chromedriver location and log level.

只需运行批处理文件,即可运行 selenium 服务器.

Just run the batch file and now you have selenium server running.

在你的配置文件中提到 Selenium 地址 127.0.0.1:4444localhost

In your config file mention Selenium address 127.0.0.1:4444 or localhost

这篇关于我怎样才能完全避免 webdriver-manager?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆