Skip to content

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

@swathikrnt

Description

@swathikrnt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions