browserstack-wrapper

1.0.0 • Public • Published

Browser-stack api wrapper

This package is wrapper of browserstack api.

Install


npm install browserstack-wrapper

API


  • getallbrowser()

Returns all listed browser. Parameters:\n flat or all (Optional).

  • newworker()

Creates new worker.
Parameters:
(Required)
os : Operating system name listed from above function,
os_version: Operating system version listed from above function,
url: Valid url to navigate the browser,
browser: Name of browser listed from above function ,
browser_version: Version of browser listed from above function.
take_shot()

Take screenshot of worker.
Parameters:
id: worker id returns from above function,
format: png,json,xml
get_status()

Fetch current status of worker.
Parameters:
id: worker id.
get_status_all()

Fetch all workers status
deleteworker()

Delete the worker
Parameters:
id : worker id.
status()

Returns the current status of api.
Example code:

    var browserstack=require('browserstack-wrapper');
    var api=new browserstack('Your user name','Your api key');
    //Get all browsers
    api.getallbrowser(function(err,data){
            if(err){
                console.log(err);
              }
            else{
                  console.log(data);
              }
    });
    //create new worker
    api.newworker('Windows','7','http://www.google.com','firefox','8.0',function(err,id){
        if (err) {
              console.log(err);
        }else{
          console.log('ID of worker : '+id);
        }
    });
    //Take screen shot
    api.take_shot('worker ID','json',function(err,url){
        if (err) {
          console.log('Error : '+err);
        }else{
              console.log('Please visit : '+url.url+'to view screen shot');
        }
    });
    //Delete worker
    api.deleteworker('worker ID',function(err,data){
      if(err){
        console.log(err);
      }else{
        console.log('time taken'+data.time);
      }
    });
    ```

Readme

Keywords

Package Sidebar

Install

npm i browserstack-wrapper

Weekly Downloads

0

Version

1.0.0

License

none

Last publish

Collaborators

  • unixroot