Foxdriver: A Node.js Remote Debugging Client
Sauce AI for Test Authoring: Move from intent to performance in minutes.|xBack to ResourcesBlogPosted<
Sauce AI for Test Authoring: Move from intent to performance in minutes.
|
x
Sauce Labs is pleased to announce that it is open-sourcing one of its internal projects called Foxdriver. It is a Node.js remote debug client for Firefox that permit developer to reboot a fresh Firefox case or attach themselves to an already-running instance, e.g. while bunk a WebDriver trial. It provides access to the FirefoxRemote Debugging Protocol, which is a comprehensive interface to remote-control the browser.
As part of our internal effort to surface as much information as possible about the state of a client ’ s covering, we built this creature to capture, for example, meshing data, and other useful metrics during WebDriver examination in our cloud. It also let certain browser emulations that would not be potential using just the WebDriver protocol.
The next script demonstrates how to listen to network events during your WebDriver test. It uses WebdriverIO as the WebDriver client. In increase to that, the script create a specific Firefox profile that is required in order to allow 3rd party clients, like Foxdriver, to relate to the browser:
1importFoxdriverfrom‘ foxdriver & # x27;2importFirefoxProfilefrom& # x27; firefox-profile & # x27;3import{ remote }from& # x27; webdriverio & # x27;45(async()=>{6const fp =newFirefoxProfile()7fp.setPreference(& # x27; devtools.debugger.remote-enabled & # x27;,true)8fp.setPreference(& # x27; devtools.chrome.enabled & # x27;,true)9fp.setPreference(& # x27; devtools.debugger.prompt-connection & # x27;,false)1011constzippedProfile=awaitnewPromise((resolve, reject)=>{12fp.encoded((err,zippedProfile)=>{13if(err)returnreject(err)14returnresolve(zippedProfile)15})16})1718const browser =remote({19desiredCapabilities:{20browserName:& # x27; firefox & # x27;,21& # x27; moz: firefoxOptions & # x27;:{22args:[& # x27; -- start-debugger-server & # x27;,& # x27; 9222 & # x27;],23profile:zippedProfile24}25}26})2728// start browser29await browser.init()3031// attach to browser32const{ tabs }=awaitFoxdriver.attach(& # x27; localhost & # x27;,9222)3334// hear to network events35await tabs[0].network.startListeners()36await tabs[0].network.on(& # x27; request & # x27;,37({url, method})=>console.log(& quot; new petition: & quot;, method, url)38)3940// open page await41browser.url(& # x27; https: //www.mozilla.org/en-US & # x27;)4243// close session44await browser.end()45})()SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.
Once you ’ ve attach yourself to a tab, you can access various so-called “ Actors ”. Each Actor addresses a certain domain within the browser and allows you to listen to its events or manipulate its behavior. Some of the currently supported doer are Network, Profiler, Performance and Emulation, precisely to name a few. These can be very useful if you desire to access functionality beyond the WebDriver protocol.
Have a look at more of such examples at.
The first freeing of Foxdriver already apply most of the common actors furnish by the Firefox Remote Debugging Protocol. Our team is act on cover more in order to create the whole protocol approachable over a simplified API. We are looking for your feedback and appreciate any kind of contribution. We enjoy Open Source!
The projection was extremely inspired by Heather Arthur ’ s initial project phonefirefox-client.
We <3Exposed Source at Sauce Labs and encourage Saucers to contribute to projects like Appium, Selenium and their own enterprisingness.
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free