问题标签 [chrome-options]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
687 浏览

selenium-chromedriver - ChromeDriver - 无头选项会导致 WebDriver 崩溃,当应用于添加的扩展程序时

我们的框架使用自动处理身份验证对话框的“基本身份验证器”扩展。问题是当尝试在无头模式下运行测试时,chromedriver 崩溃并出现以下错误:

org.openqa.selenium.WebDriverException:未知错误:等待扩展背景页面加载失败:chrome-extension://paomkgjogbncmncdnconbommejfdhaoh/_generated_background_page.html 来自未知错误:找不到页面:chrome-extension://paomkgjogbncmncdnconbommejfdhaoh/ _generated_background_page.html

0 投票
1 回答
1838 浏览

javascript - 在 JavaScript 中访问 Chrome 选项(可选:来自 Galen 测试)

我正在使用 Galen(一个用于测试 HTML 页面布局的 JS 工具)。它是从无法使用 ES6 JS 的 .js 文件配置的 :-(

我需要ChromeOptions从 Chrome 驱动程序加载/修改,但我不知道如何访问它。我看到很多关于如何设置选项的示例,但是当我这样做时:

我收到一条错误消息:ReferenceError: "chrome" is not defined 我尝试过使用require()load()功能,但使用 require 我得到了类似的未定义错误(我认为是 ES6 问题),并且负载我似乎无法将它指向一个有效的脚本,我尝试过:

似乎这不是 Galen 使用的 webdriver,但我如何找到它正在使用的 webdriver?load()用什么来加载它的?

0 投票
0 回答
150 浏览

.net - .NET - Selenium chromeOptions 为 devtools 设置首选项

我正在尝试使用以下代码(Selenium)在 .net 中为 chrome webdriver 设置 devtool 首选项

但它没有得到它,因为“Inspector.drawerSplitView”应该作为一个属性保留,但是 AddUserProfilePreference 由于一个点而从中生成了一个子 json。喜欢

但实际上应该是:

有没有办法克服这个?

0 投票
3 回答
2133 浏览

selenium - selenium RemoteWebDriver 打开,但 ChromeOptions 未传递给 Selenium Grid

我一直在尝试使用 docker 和 selenium grid 解决 RemoteWebDriver 和 ChromeOptions 的一些问题。主要问题在于代理,但我通过代理 pac 文件将 pac 文件 url 作为 arg 传递到 ChromeOptions 中解决了一半。下面的代码在 docker debug 和本地独立运行时运行良好,但是一旦我尝试使用网格或部署并使用竹子运行,驱动程序就会打开,我可以看到 ChromeOptions 没有被传递,因为没有使用 poxy pac 文件,它是刚刚冻结在 org.openqa.selenium.remote.ProtocolHandshake createSession。我已经研究了几个星期了,现在我正处于一个困难的阶段。我看过一些帖子说 DesiredCapabilities 已被弃用,但我还没有找到一种方法来实现 ChromeOptions 没有它。

0 投票
1 回答
272 浏览

java - webdriver有哪些不同的chromeoptions

对于 selenium 中的 ChromeOptions 类,我怎样才能找到我可以与 chromeoptions 类一起使用来执行浏览器特定设置的所有键,例如profile.default_content_settings.popupsdownload.default_directory 。

0 投票
2 回答
8785 浏览

java - Selenium - 移动仿真 - 如何在自动化模拟器时将用户代理添加到 Chrome 选项?

以下是我添加的功能。我在我的网站上得到了一个谷歌 reCAPTCHA,可以通过添加用户代理来侵入。

但即使在添加用户代理之后,我仍然会收到验证码。有没有其他方法可以添加?

0 投票
1 回答
233 浏览

python-3.x - selenium python fullscreen_window

I want to put full window, but it only leaves me 800x600

I'm doing tests with selenium, but the window is very inferior. help how could you put maximum window.

0 投票
0 回答
1703 浏览

selenium - How to change already set chrome options while running tests?

While sharing screen from webrtc application, user gets 3 options. 1. Share entire screen 2. Share specific tab 3. Share specific application

I need to automate these TC's. Have found a way to do it individually on different browser driver by setting chrome option like :

options = webdriver.ChromeOptions() options.add_argument("--auto-select-desktop-capture-source=Entire screen") -- for sharing entire screen.

But is there any way to perform all 3 cases using same driver by editing chrome option run time?

0 投票
2 回答
551 浏览

selenium-chromedriver - Geb - 未使用 ChromeOptions

忽略在 IntelliJ 中启动的 GebConfig.groovy 文件的 Geb 测试帮助我使用了 ChromeDriver,但现在我遇到了一个问题,即尽管提供了 ChromeOptions,但它没有被使用。

我采用了提供的解决方案,并添加了其他 StackOverflow 解决方案中的分配:

现在浏览器可以正常运行,但是optsare not used: 没有最大化,并且浏览器的外观显然不正确。当我使用直接 Selenium 时,我遇到了同样的问题,我通过使用上面的 user-data-dir 解决了这个问题。也使用相同的 ChromeDriver。

程序输出说:

尝试过(已弃用)DesiredCapabilities,但相同。

TIA

0 投票
1 回答
8470 浏览

python - 更改现有网络驱动程序中的 ChromeOptions

场景:需要将文件从 Web 层次结构下载到同一层次结构下的本地驱动器。

示例 Web 层次结构:

下载文件 1 时,它应该存储在路径 1 - "C:\....\Downloads\Parent 1\Child 1\"

下载文件 2 时,它应该存储在路径 2 - "C:\....\Downloads\Parent 1\Child 2\"

问题

当我第一次在 setUp() 中初始化 webdriver 并下载“文件 1”时,当我在 chrome webdriver 中保留“C:....\Downloads\Parent 1\Child 1\”下载路径时,它会下载到预期的文件夹中。但是当我在 chrome webdriver 中设置下一个“C:....\Downloads\Parent 1\Child 2\”下载路径以在其中下载文件 2 时,它会打开另一个 chrome 浏览器,因为我正在使用另一个 webdriver 来设置路径 2。

所需解决方案

我想使用现有的 webdriver 来设置不同的 chrome 下载路径或您能想到的任何其他解决方法。

当前代码

如果您需要任何其他信息,请告诉我。

提前致谢!