I would like to capture the Net panel output from Firebug while running a test through WebDriver. I was thinking of doing this using NetExport to dump the info to a har file. How can I activate Firebug to do the export while a particular page is displayed using "driver.get()"?
Firebug is a Mozilla Firefox add-on. This tool helps us in identifying or to be more particular inspecting HTML, CSS and JavaScript elements on a web page. It helps us identify the elements uniquely on a webpage.
What is FirePath. It is an extension to FireBug that adds a development tool to edit, inspect and generate XPath expressions and CSS3 Selectors.
Just go to Tools >> Web Developer >> Get More Tools. 2- Search for the FirePath plugin and click on the “Add to Firefox” button. Downloading FirePath Add-on in FireFox.
Google's Answer: get() is used to navigate particular URL(website) and wait till page load. driver. navigate() is used to navigate to particular URL and does not wait to page load.
You need the Firestarter extension in addition to Firebug and NetExport. Here's how I do it in Ruby:
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension "path/to/firebug.xpi"
profile.add_extension "path/to/fireStarter.xpi"
profile.add_extension "path/to/netExport.xpi")
profile['extensions.firebug.currentVersion'] = "1.7.0a3" # avoid 'first run' tab
profile["extensions.firebug.previousPlacement"] = 1
profile["extensions.firebug.onByDefault"] = true
profile["extensions.firebug.defaultPanelName"] = "net"
profile["extensions.firebug.net.enableSites"] = true
profile["extensions.firebug.netexport.defaultLogDir"] = output_dir
profile["extensions.firebug.netexport.alwaysEnableAutoExport"] = true
driver = Selenium::WebDriver.for :firefox, :profile => profile
Equivalent APIs are avilable in Java. Make sure the extensions are compatible with each other (and your Firefox version).
If you're using Ruby (or just want to quickly launch a HAR viewer from the command line), check out my HAR gem for an easy way to work with the data later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With