phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

captureNetworkTraffic option?

Open daluu opened this issue 12 years ago • 3 comments

Just wondering if PHPUnit supports the Selenium captureNetworkTraffic setting that is available for other languages like Java and Python. If not, can we please consider adding as option for the Selenium extension to PHPUnit? It would be useful for additional testing of HTTP responses that come through the browser (like API requests made through AJAX that may have issues that don't show up in the browser UI) as well as perfromance benchmarks of download times of elements on a page.

For reference, I'm talking about this type of code snippet available to Python and Java:


try: sel.start('captureNetworkTraffic=true') except socket.error: print 'ERROR - can not start the selenium-rc driver. is your selenium server running?' sys.exit(1)

sel.open(path) sel.wait_for_page_to_load(60000)

end_loading = datetime.now()

raw_xml = sel.captureNetworkTraffic('xml') // we can then process the captured traffic as we please via text parsing


For an example of how someone used the network capture to do performance profiling, see this Python example:

http://code.google.com/p/selenium-profiler/source/browse/trunk/web_profiler.py

daluu avatar Sep 28 '11 21:09 daluu