-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hi,
I am wondering if there is way to get the har log as a string or object using selenium in java? Currently I would have to read from the saved har file and read that in as a string. I know we can trigger the har export through java script, but I don't know how to get it in the java code...
Something like this?
driver.get("https://google.com");
if(driver instanceof JavascriptExecutor) {
((JavascriptExecutor) driver).executeScript(
" var options = { token: "mySpecialValue", getData: true, title: "Title for the HAR log", jsonp: false,};" +
"HAR.triggerExport(options).then(result => { var har = JSON.parse(result.data); console.log("HAR log: ", har.log);}, err => { console.error(err);});");
}
then, how do I get it in java code...
Thanks!
Metadata
Metadata
Assignees
Labels
No labels