webdrivermob

0.0.6 • Public • Published

WebDriverMob

Utility lib to build webdriver object with browsermob http proxy. this could be used to record HAR files, or other features supported by BrowserMob Proxy.

Lear more about BrowserMob here : https://github.com/lightbody/browsermob-proxy

Sample Usage

var wMob = require("WebDriverMob")
    , w = new wMob();
    
//setting up browsermob and selenium

w.setup().then(seleniumTest, function (error) {
    console.error(error);
    process.exit(1);
})

//selenium test to get to Page under Test, and record HAR file
function seleniumTest() {
    //get driver with proxy
    var driver = w.getDriver();
    driver.get('http://www.imdb.com');
    driver.getTitle().then(function(data){
        //this could be called multiple times, as and when you want to record har files
        w.writeAndClearHar("imdb-har.json").then(function (data) {
            driver.quit();
            process.exit();
        });
    });
}

Package Sidebar

Install

npm i webdrivermob

Weekly Downloads

7

Version

0.0.6

License

none

Last publish

Collaborators

  • proverma