Skip to main content

A python client for running tests in browserstack

Project description

python-browserstack

A python client for running tests in browserstack

About

This package aims to provide a straighforward python client to interact with browserstack

Pre-requisites

  • py-bs requires Python3 to run
  • selenium installed if not pip3 install selenium

Installation

This client is hosted at PyPi under the name mailchimp3, to install it, simply run

pip install py-bs

Examples

import py-bs as bs
from selenium import webdriver

def test_bs():
    try :
        desired_cap = {
                'browser': 'Chrome',
                'browser_version': '83.0',
                'os': 'Windows',
                'os_version': '10',
                'resolution': '1024x768',
                'name': 'Bstack-[Python] Sample Test'
                }
        username = ''
        accesskey = ''
        driver = bs.get_webdriver(username,username,desired_cap)
        driver.get("http://www.google.com")
        if not "Google" in driver.title:
            raise Exception("Unable to load google page!")
        elem = driver.find_element_by_name("q")
        elem.send_keys("BrowserStack")
        elem.submit()
        print(driver.title)
        driver.quit()
    except:
        driver.close()
        driver.quit()


if __name__ == "__main__":
    test_bs()

Obtain your username and accesskey values from browserstack settings and Update the values of variable names username & accesskey

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_bs-0.0.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file py_bs-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: py_bs-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.47.0 CPython/2.7.12

File hashes

Hashes for py_bs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d8f5b5a753be0a2a0ec6342647c039a76b00161ef579cb7e41c3882ce962052
MD5 65ef923f96088dd508ccd49134d70f2b
BLAKE2b-256 2ef7ca4321e4927a0b1871712f20a6ef9d158218fb2d2a4813c04957acc8d4f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page