How to get Request Payload from Network logs of browser using Webdriver +Java

3,586 views
Skip to first unread message

Pramod Sadaphal

unread,
Jun 2, 2015, 2:25:19 PM6/2/15
to webd...@googlegroups.com
Hi, 

I want to automate following steps.

1. Open browser and launch URL
2. Click F12 key of keyboard. This will open a window
3. Now go to Network option from opened window
4. Now on your website search or click on links
5. Network logs shows up in window
6. Click on any log >> Headers option shows up
 
Question is how to get parameters from this header option?(Request Payload option shows under Header, how to get it?)

Thanks, 
pr@mod

krishnan.ma...@gmail.com

unread,
Jun 2, 2015, 9:06:57 PM6/2/15
to webd...@googlegroups.com

You should just plug in a proxy server such as BrowserMobProxy, generate a HAR file and get this information from the HAR file.

Please google for "BrowserMobProxy" and that should get you started.

-Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else"

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

darrell

unread,
Jun 3, 2015, 9:05:47 AM6/3/15
to webd...@googlegroups.com
WebDriver is good for simulating what happens inside a web browser. Step 1 is complete Selenium:

    WebDriver driver = new ChromeDriver();  // open a browser
    driver.get("http://www.google.com");         // launch URL

Step 2 is interacting with the application running on your operating system. Pressing F12 is an operating system action and has nothing to do with interacting with a website. You'll have to use some other tool that integrates with Selenium to do this step.

For step 3 it is not clear what 'window' you are using. If this is a window outside the browser then you cannot automate this using Selenium. You probably need to use the same tool you used in step 2.

Step 4 would be going back to calling Selenium. How you would do this manually, step by step, would determine how you do this with Selenium.

Step 5 is back to the tool you integrated with Selenium.

Step 6 appears to be like step 5. How the 'other' tool gets the Header information into your programming language would determine how you answer your question. It is also nothing to do with Selenium. 
Reply all
Reply to author
Forward
0 new messages