Skip to content

Keywords for network statistics and metrics #25

Closed

Description

@daluu

In particular, performance timings of content/file downloads, uploads, etc. along with viewing HTTP headers sent/received in browser.

Selenium RC had a captureNetworkTraffic option on startup of browser session to enable such functionality, though the user of course had to manually parse the desired data (or look for third party Selenium tools that did that).

WebDriver unfortunately doesn't natively support this, so just opening up a tracking issue for discussion and consideration of adding such functionality perhaps with third party tools.

See following for references:

Matching SeleniumLibrary issue 206
http://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=206

Request for such functionality at RF user group
http://groups.google.com/group/robotframework-users/browse_thread/thread/c44178c9edb4febe

Third party solutions to desired feature:
http://deanhume.com/Home/BlogPost/measuring-web-page-performance-with-selenium-2-and-the-web-timings-api/56
http://www.theautomatedtester.co.uk/blog/2010/selenium-webtimings-api.html
http://sevenseconds.wordpress.com/2011/06/28/velocity-conference-2011-workshop-on-automated-web-performance-testing/
http://www.supermind.org/blog/968/howto-collect-webdriver-http-request-and-response-headers

Activity

  1. emanlove commented on Dec 22, 2011

    @emanlove
    Member

    daluu, Have you seen the robotframework-httplibrary and it's various forks? Some of this functionality might already be present there or more appropriate for that library.

  2. daluu commented on Dec 23, 2011

    @daluu
    Author

    emanlove, yes, I've heard of that library, but didn't check out the forks. Nevertheless, it doesn't quite fit with the issue here. This issue is about doing testing with WebDriver and at the same time being able to query for the browser data such as HTTP headers and as a result of that also extrapolate timing statistics.

    This was possible as part of Selenium RC via captureNetworkTraffic option. It isn't available to WebDriver and must be extended via third party tools unless it is somehow incorporated in future WebDriver releases.

    But you are right that if I just wanted pure HTTP request/response testing, I could use the mentioned library or similar.

    While the use case of this issue is not a widely requested or needed feature, it does have its uses. Same as how developers can check HTTP headers, cookies, and related data via browser extensions like Firebug, we would want same functionality exposed via Selenium to extract out with our tests for debugging or performance analysis, etc. rather than do it via separate tools in separate tests/scripts, etc.

  3. emanlove commented on Dec 23, 2011

    @emanlove
    Member

    daluu, thanks for helping me understand these issues better. I've not yet had a need for this type of functionality so you have really helped me to see better how it fits into the robotframework-selenium2library, what your needs are, and what greater possibilities there are for me to use the framework for.

  4. lsjuanny commented on Feb 4, 2012

    @lsjuanny

    There is a reason I think we need this feature:
    On a webpage, a javascript execution trigger a http request. This happens typically when the webpage need send logging information to server. Such as following scenarios:

    1. When user stay on one page for more than 3 seconds, it will send log to server
    2. When user open a open a drop down menu and select a item, it will send log to server
      And so on.

    For this kind of scenarios, I can got two reason why robotframework-httplibrary is not suitable here.

    1. The thing we need test is the behavior of javascript execution.
    2. We need check if it works well in all kinds of browser.
  5. daluu commented on Dec 18, 2012

    @daluu
    Author

    It's may also be useful for testing/verifying AJAX web requests w/o simulating it w/ an external library/tool. But usually simulation is good enough though.

  6. ombre42 commented on Nov 9, 2013

    @ombre42
    Contributor

    Has anyone tried to use BrowserMobProxy? That seems like it would help gather the information. It is not tied to Selenium and so should have its own library for Robot Framework.

  7. daluu commented on Nov 10, 2013

    @daluu
    Author

    That would be nice if there was a BrowserMobProxyLibrary to combine with Selenium2Library for testing in this area.

  8. SteveHarrison82 commented on Jun 3, 2015

    @SteveHarrison82

    I would like to share the following link:
    https://github.com/Work4Labs/selenium-simple-test/blob/72569ee775425273859b36c201508a973ce2db00/src/sst/actions.py.

    I came across browser mob some days back from this link and was not aware of its requirement at that time. From the glimpse, the snippet appears to use webdriver

  9. just-be-dev commented on Jun 3, 2015

    @just-be-dev
    Contributor

    That would be a good reference for a BrowserMob Proxy library. They're using BrowserMob's restful api. Thanks for the resource @rama-bornfree, I might do something with this!

  10. SteveHarrison82 commented on Jun 3, 2015

    @SteveHarrison82

    Welcome, I will try to understand the snippet

  11. just-be-dev commented on Jul 17, 2015

    @just-be-dev
    Contributor

    I'm working on a BrowserMob Proxy library that would be more appropriate for this. As far as I'm concerned this is outside of the scope of S2L so I'm going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions