问题描述
我是Selenium和Webdriver的新手。我正在尝试在节点中使用Webdriverjs编写测试。我希望硒加载我的默认铬配置文件。这是我正在尝试,但它仍然加载一个新的铬配置文件。
var webdriver = require('selenium-webdriver');
var chrome = require('selenium-webdriver / chrome');
var o = new chrome.Options();
o.addArguments( - user-data-dir = / Users / karnesh / Library / Application Support / Google / Chrome / Default);
var driver = new webdriver.Builder()。withCapabilities(webdriver.Capabilities.chrome())
.setChromeOptions(o).build();
任何想法我错了?
另外,我无法找到webdriverjs的文档。任何指向它的链接(如果存在的话)都会有所帮助。谢谢
chrome:// version 它可以看到你当前的配置文件路径。
我在Windows8机器上使用 2.46.1 ,在浪费(投资)几小时的时间后,我意识到默认是默认附加的。
因此,为了使用我的另一个档案 - 档案1 - 我必须复制它某处并将它放在默认目录下。
不知道这是一个错误还是一个功能。
更新:
I am new to Selenium and Webdriver. I am trying to write tests using Webdriverjs in node. I want selenium to load my default chrome profile. This is what I am trying, but it still loads a new chrome profile.
var webdriver = require('selenium-webdriver'); var chrome = require('selenium-webdriver/chrome'); var o = new chrome.Options(); o.addArguments("--user-data-dir=/Users/karnesh/Library/Application Support/Google/Chrome/Default"); var driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()) .setChromeOptions(o).build();
Any ideas where I am going wrong??
Also, I was not able to find a documentation for webdriverjs. Any links to it (if it exists) would be helpful . Thanks
chrome://version is your friend - by using it you can see what is your current profile path.
I'm using 2.46.1 on Windows8 machine and after wasting (investing) a few hours of my time I realised that Default is appended by default.
So in order to use my another profile - "Profile 1" - I have to copy it somewhere and place it under Default directory.
Not sure if that's a bug or a feature.
UPDATE: https://github.com/SeleniumHQ/selenium/issues/854
这篇关于使用Webdriverjs Selenium加载默认chrome配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!