我正在制作一个应用程序,我想使用chrome URL快捷方式将其安装在用户的桌面上.因此,是否存在chrome.exe的通用路径,可以在所有Windows版本(XP,Seven和vista)上启动我的应用程序
首先,机器和包装规格:我正在运行:
ChromeDriver version 75.0.3770.140
Selenium: version '3.141.0'
WSL (linux subsystem) of windows 10
Run Code Online (Sandbox Code Playgroud)
我正在尝试通过 Selenium 运行 chrome 浏览器。我发现:这些命令,通过谷歌浏览器使用硒。
我有一个测试目录,其中仅包含 chromedriver 二进制文件和脚本。目录位置为:/home/kela/test_dir/
我运行了代码:
import selenium
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
options = Options()
options.binary_location='/home/kela/test_dir/chromedriver'
driver = webdriver.Chrome(chrome_options = options,executable_path='/home/kela/test_dir/chromedriver')
Run Code Online (Sandbox Code Playgroud)
该代码的输出是:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: No matching capabilities found
Run Code Online (Sandbox Code Playgroud)
谁能解释为什么当同一个脚本适用于其他没有功能的脚本时我需要功能?我确实尝试添加:
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
Run Code Online (Sandbox Code Playgroud)
但我得到了同样的错误。所以我不确定我需要添加哪些功能(考虑到它对没有它的其他人也适用?)
编辑 1:解决 DebanjanB 的以下评论:
Chromedriver 位于预期位置。我使用的是 Windows 10。从这里开始,预期位置是 C:\Program …
selenium google-chrome webdriver selenium-chromedriver selenium-webdriver
我的应用程序正在 localhost 上运行,但是当我在 heroku 上部署时,puppeteer 应用程序需要此模块https://github.com/jontewks/puppeteer-heroku-buildpack。puppeteer node_module 大小约为 300mb,该模块大小为 200。总大小为 539mb。请提出一个好的解决方案
我想从我的自动化测试框架启动 chrome,以便我可以测试我的服务器端 ASP.NET 代码。确定 chrome.exe 在我的计算机上的位置的最佳方法是什么?
asp.net ×1
c# ×1
heroku ×1
heroku-api ×1
heroku-cli ×1
node.js ×1
puppeteer ×1
selenium ×1
webdriver ×1