If you have already ready my article on scripting HTTPS web applications, you already know that it’s not so straight forward. What if you work for a client, your access is restricted and you are not able to add trusted root certificates? What if, you have to go through a long and tedious ticket based workflow to get this certificate added? What if, you are running on a tight schedule and you want to be able to record the script now – not tomorrow, not later today but NOW?!
Worry not! There are alternatives! VuGen 12.x provides you the option of generating scripts based on .har files. HAR (acronym for HTTP Archive) files could be easily generated using your browser or a proxy like Fiddler. In this article, I’m going to detail the steps to follow, in order to be able to script “LinkedIn” (an application using HTTPS) using HAR files.
Step 1: Open a new browser window and right click on the home page to get the menu options. Select “Inspect” to open the browser “Web Tools” frame
Step 2: The below “Web Tools” frame is added to your browser window
Step 3: Click on the “Network” tab and make sure that the RED “Record” button is enabled and the “Preserver Log” check box is enabled
Step 4: Enter the URL of the web page, you want to test (LinkedIn, in our case), in your browser’s address bar and press enter key
Step 5: You can see that all the network communication between your browser and the application’s servers are captured in the recording log
Step 6: Export this recording log in to a har file by right clicking on the recording log and selecting “Save as HAR with Content” option
Step 7: Open VuGen. Go to File -> New Script and Solution
Step 8: Select “Web-HTTP/HTML” protocol in the “Create a New Script” dialog
Step 9: Click on the “Record” button
Step 10: In the “Recording mode” section, select “Captured Traffic File Analysis” as the recording option
Step 11: Enter the location of the captured “LinkedIn.har” file in the “Captured file” field and click “Start Recording” button
Step 12: VuGen analyzes the captured traffic and creates a script for you, like shown below
That’s it. You have recorded your script! Now you can enhance this (parameterize,correlate ..) and use this to test your web page.