# Capturing session information

**URL:** https://forum.robotframework.org/t/capturing-session-information/4825
**Category:** Browser
**Created:** [17 October 2022 14:22 UTC](https://forum.robotframework.org/t/capturing-session-information/4825 "2022-10-17T14:22:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hemu434](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hemu434](https://forum.robotframework.org/u/hemu434)
#### Post date: [17 October 2022 14:22 UTC](https://forum.robotframework.org/t/capturing-session-information/4825/1 "2022-10-17T14:22:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![hemu434](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hemu434](https://forum.robotframework.org/u/hemu434)
#### Post date: [27 October 2022 07:26 UTC](https://forum.robotframework.org/t/capturing-session-information/4825/2 "2022-10-27T07:26:56Z")

</div>

Hi Team,

Can someone please help me out here with this

Many thanks in advance.  
Hemanth

---

<div class="post-metadata">

### Author: ![Maiska123](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/maiska123/32/2921_2.png) [@Maiska123](https://forum.robotframework.org/u/Maiska123)
#### Post date: [19 August 2023 19:11 UTC](https://forum.robotframework.org/t/capturing-session-information/4825/3 "2023-08-19T19:11:43Z")

</div>

i think i got it. har file got the stuff when i did put the “New Page” right after HAR configure.

```
${har_config}=
        ... Create Dictionary
        ... path=${HAR_FILE_PATH}
        ... omitContent=True
        New Context recordHar=${har_config}
        New Page http://${URL} # This one did the trick

```
