-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can it be used with Selenium 3? #44
Comments
@dpburst thanks for the report! I don't have much experience with Selenium, can you provide some instructions to help me to it setup up on my machine and try the addon with it? Thanks! |
@janodvarko Thank you so much for your reply. Here is my code (but it can not work):
I find that My settings are: Greatly appreciate it if you could make it work! Thanks! |
I installed Selenium via
const { Builder, By, Key, until } = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');
const HARDIR = "C:\\src\\www\\selenium\\first-test\\logs";
/**
* Test entry point.
*/
async function runTest() {
let driver;
try {
const options = new firefox.Options()
.setPreference("extensions.firebug.allPagesActivation", "on")
.setPreference("devtools.netmonitor.enabled", true)
.setPreference("extensions.netmonitor.har.enableAutomation", true)
.setPreference("extensions.netmonitor.har.contentAPIToken", "test")
.setPreference("extensions.netmonitor.har.autoConnect", true)
.setPreference("devtools.netmonitor.har.compress", false)
.setPreference("devtools.netmonitor.har.defaultFileName", "Autoexport_%y%m%d_%H%M%S")
.setPreference("devtools.netmonitor.har.defaultLogDir", HARDIR)
.setPreference("devtools.netmonitor.har.enableAutoExportToFile", true)
.setPreference("devtools.netmonitor.har.forceExport", true)
.setPreference("devtools.netmonitor.har.includeResponseBodies", false)
.setPreference("devtools.netmonitor.har.jsonp", false)
.setPreference("devtools.netmonitor.har.jsonpCallback", false)
.setPreference("devtools.netmonitor.har.pageLoadedTimeout", "2500")
.addArguments("--devtools", "")
.addExtensions('./har_export_trigger-0.6.1-an+fx.xpi');
const driver = await new Builder()
.forBrowser('firefox')
.setFirefoxOptions(options)
.build();
//await driver.installAddon('./har_export_trigger-0.6.1-an+fx.xpi');
await driver.get('http://janodvarko.cz/test/harexporttrigger');
let title = await driver.getTitle();
console.log("The title is: " + title);
driver.findElement(By.id("xhr1")).click();
driver.findElement(By.id("xhr1")).click();
await driver.sleep(2000);
await driver.quit();
} catch (err) {
console.log(err);
}
};
runTest(); |
Hi! I am just wondering whether this addon can be used together with Selenium 3? I just wrote a demo, trying to get HAR with python selenium 3. But it seems that it is not working at all (with no har file generated).
Here is my profile setting. I am testing on MacOS, firefox 78.3.0esr and Selenium 3.141.0.
` profile.set_preference("extensions.netmonitor.har.enableAutomation", True);
profile.set_preference("extensions.netmonitor.har.contentAPIToken", "test");
profile.set_preference("extensions.netmonitor.har.autoConnect", True);
The text was updated successfully, but these errors were encountered: