A python client for running tests in sauce labs
Project description
pythonsl
A python client for running tests in sauce labs
About
This package aims to provide a straighforward python client to interact with sauce labs
Pre-requisites
- pythonbs requires Python3 to run
- selenium installed if not
pip3 install selenium
Installation
This client is hosted at PyPi under the name pythonsl, to install it, simply run
pip install pythonsl
Examples
import pythonsl as sl
from selenium import webdriver
def test_sl():
try :
capabilities = {
'browserName': 'chrome',
'browserVersion': '70.0',
'platformName': 'Windows 10'
}
username = ''
accesskey = ''
driver = sl.get_webdriver(username,accesskey,capabilities)
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_sl()
Obtain your username and accesskey values from sauce labs user settings and Update the values of variable names username & accesskey Run your file and you will see your script run in sauce labs
You can change the desired capabilities by referring to - https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythonsl-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pythonsl-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83fd1c393a7cf1b3052acb5d1f2b1ce4a3afd3e0933266534d491773af45d531
|
|
| MD5 |
91b9979935a151b8163d0f96587edda5
|
|
| BLAKE2b-256 |
615f61f02479c2574dd7e4152c23d636903d600875a03cf4e4508d2ee90036f3
|