GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - browserstack/ruby-browserstack: Ruby gem for interacting with the browserstack api

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
lib
lib
 
 
spec
spec
 
 
.gitignore
.gitignore
 
 
.rspec
.rspec
 
 
.ruby-gemset
.ruby-gemset
 
 
.ruby-version
.ruby-version
 
 
CODEOWNERS
CODEOWNERS
 
 
Gemfile
Gemfile
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
browserstack.gemspec
browserstack.gemspec
 
 

Repository files navigation

Browserstack

A ruby gem for working with BrowserStack through its API.(V2 API only)

Installation

Add this line to your application's Gemfile:

gem 'browserstack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install browserstack

Example of Use

First, you're probably gonna want to require it:

require 'browserstack'

Creating Client

Creates a new client instance.

  • settings: A hash of settings that apply to all requests for the new client.
    • username: The username for the BrowserStack account.
    • password: The password for the BrowserStack account.
client = Browserstack::Client.new(username: "foo", password: "foobar")

###API

####Getting available browsers Fetches all available browsers.

client.get_browsers #returns a hash

or for a specific OS

client.get_browsers("mac")

####Getting list of supported OS

client.get_supported_os_list 

####Creating a worker A worker is simply a new browser instance.

enc_url = URI.escape("http://example.com/?a=\111\\115")
settings = {os: "win", browser: "ie", version: "7.0", url: enc_url}
worker_id = client.create_worker(settings)

A worker id is returned after worker gets created.

  • settings: A hash of settings for the worker
    • os: Which OS to use for the new worker.
    • browser/device: Which browser/device to use in the new worker. Which property to use depends on the OS.
    • version: Which version of the specified browser to use.
    • url : Which URL to navigate to upon creation.
    • timeout (optional): defaults to 300 seconds. Use 0 for "forever" (BrowserStack will kill the worker after 1,800 seconds).

####Terminating a worker Use this method to terminate an active worker. A hash with indicating how long the worker was alive is returned.

data = client.terminate_worker(worker_id)

####Getting worker status Determines whether the worker is in queue, running or terminated.

worker = client.get_worker_status(worker_id)
  • worker: A hash representing the current status of the worker and worker properties.
    • returns an empty hash if worker is terminated.

####Getting all workers of a client

workers = client.get_workers

Returns an array of all workers with all their properties

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Ruby gem for interacting with the browserstack api

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

8 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.