Hello,
I’m trying to capture the session information into a HAR file. But when I run my robot test, I could see that the HAR file is getting created. However, the file contains limited session information.
Libraries Used:
Browser, BuiltIn, JSONLibrary
Here is the content that I could see in my generated HAR file
{‘log’: {‘version’: ‘1.2’, ‘creator’: {‘name’: ‘Playwright’, ‘version’: ‘1.19.2’}, ‘browser’: {‘name’: ‘chromium’, ‘version’: ‘100.0.4863.0’}, ‘pages’: , ‘entries’: }}
Note: ‘pages’ and ‘entries’ are empty in the generated HAR file
Robot Keywords:
Configure HAR
${har_config}= Create Dictionary path=${HAR_FILE_PATH}
Log to console HAR config is ${har_config}
New Context recordHar=${har_config}
Parse HAR
${json}= Load Json From File ${HAR_FILE_PATH}
Log to console ${json}
@{urls}= Get Value From Json ${json} $.log.pages
Log to console ${urls}
Please can someone help me here to capture the whole session information
Many thanks in advance