Skip to content
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

HAR.triggerExport(options).then(result => { }); not creating .har file under profile #39

Open
swathikrnt opened this issue Aug 16, 2019 · 0 comments

Comments

@swathikrnt
Copy link

swathikrnt commented Aug 16, 2019

I am using .net(c#) with Selenium for capturing the network log
I have Firefox Developer Edition 69

FirefoxProfile profile = new FirefoxProfile();
var allProfiles = new FirefoxProfileManager();
profile = allProfiles.GetProfile("Selenium");

string harExport = "C:/Users/testUser/Desktop/harexport/harexporttrigger-0.5.0-beta.10.xpi";
profile.AddExtension(harExport);

profile.SetPreference("extensions.netmonitor.har.contentAPIToken", "test");
profile.SetPreference("extensions.netmonitor.har.autoConnect", true);
profile.SetPreference("devtools.netmonitor.har.defaultLogDir", "C:\Users\TestUser\AppData\Roaming\Mozilla\Firefox\Profiles\x7z2jjfb.Selenium");
profile.SetPreference("devtools.netmonitor.har.enableAutoExportToFile", true);
profile.SetPreference("devtools.netmonitor.har.forceExport", true);
fireFoxoptions.Profile = profile;

/// code to Generate har File
string sessionHar = " var options = { token: "test"}; " +
"HAR.triggerExport(options).then(result => { });";
if (WebDriver != null)
{
((IJavaScriptExecutor)WebDriver).ExecuteScript(sessionHar);
}

However its not creating a Har file under my profile
when I execute the script from console

Promise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants