From 5eb400e6b80590542a8e0e9112ad561258873b12 Mon Sep 17 00:00:00 2001 From: Varun Garg Date: Mon, 25 Feb 2019 20:06:36 +0530 Subject: [PATCH 1/3] Environment variables, readme and code improvements Signed-off-by: Varun Garg --- .vscode/settings.json | 4 +++ README.md | 6 ++-- google-search-browserstack.py | 7 +++-- google-search-local.py | 15 ---------- nose-test/README.md | 13 +++++++++ nose-test/README.mkd | 7 ----- nose-test/google-search-browserstack.py | 6 ++-- parallel_tests/README.md | 38 ++++--------------------- parallel_tests/test.py | 10 +++++-- py.test/README.md | 12 ++++++++ py.test/README.mkd | 7 ----- py.test/google-search-browserstack.py | 8 ++++-- unittest/google-search-browserstack.py | 5 ++-- 13 files changed, 61 insertions(+), 77 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 google-search-local.py create mode 100644 nose-test/README.md delete mode 100644 nose-test/README.mkd create mode 100644 py.test/README.md delete mode 100644 py.test/README.mkd diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4e1520b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python.linting.pylintEnabled": true, + "python.pythonPath": "/usr/local/bin/python" +} \ No newline at end of file diff --git a/README.md b/README.md index ae9d7a2..1b32a07 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -automate-python-samples -======================= +# automate-python-samples Documentation for writing Automate test scripts in Python. +## Environment variables +To test varios sample repositories with ease, it is recommended to setup `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables. If you don't wish you can directly edit the samples and add add credentials in them. + ## Install Python ### For Windows: diff --git a/google-search-browserstack.py b/google-search-browserstack.py index 32be3c1..005cb5a 100644 --- a/google-search-browserstack.py +++ b/google-search-browserstack.py @@ -1,3 +1,4 @@ +import os import sys from selenium import webdriver @@ -5,14 +6,14 @@ from selenium.webdriver.common.desired_capabilities import DesiredCapabilities try: - USERNAME = sys.argv[1] - BROWSERSTACK_ACCESS_KEY = sys.argv[2] + USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[1] + BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[2] except IndexError: print("Pleaes provide the username and browserstack access key as command line arguments.") sys.exit(1) driver = webdriver.Remote( - command_executor='http://%s:%s@hub.browserstack.com/wd/hub' %( + command_executor='http://%s:%s@hub.browserstack.com/wd/hub' % ( USERNAME, BROWSERSTACK_ACCESS_KEY ), desired_capabilities=DesiredCapabilities.FIREFOX diff --git a/google-search-local.py b/google-search-local.py deleted file mode 100644 index a4b246f..0000000 --- a/google-search-local.py +++ /dev/null @@ -1,15 +0,0 @@ -from selenium import webdriver -from selenium.webdriver.common.keys import Keys -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities - -driver = webdriver.Firefox() -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("selenium") -elem.submit() - -print driver.title -driver.quit() diff --git a/nose-test/README.md b/nose-test/README.md new file mode 100644 index 0000000..4051e62 --- /dev/null +++ b/nose-test/README.md @@ -0,0 +1,13 @@ +# A sample to run nosetests over BrowserStack Automate. + +### Setup +`pip install nose2` + + +### Running the tests + +To run the tests, add you credentials to `google-search-browserstack.py` and execute: + +``` +nose2 google-search-browserstack +``` diff --git a/nose-test/README.mkd b/nose-test/README.mkd deleted file mode 100644 index 9afdb02..0000000 --- a/nose-test/README.mkd +++ /dev/null @@ -1,7 +0,0 @@ -A sample to run nosetests over BrowserStack Automate. - -To run the tests, add you credentials to `google-search-browserstack.py` and execute: - -``` -nosetests google-search-browserstack.py -``` diff --git a/nose-test/google-search-browserstack.py b/nose-test/google-search-browserstack.py index 7bc615c..b82b4ae 100644 --- a/nose-test/google-search-browserstack.py +++ b/nose-test/google-search-browserstack.py @@ -1,3 +1,4 @@ +import os import sys import unittest @@ -6,12 +7,11 @@ from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # Edit these to match your credentials -USERNAME = None -BROWSERSTACK_ACCESS_KEY = None +USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[3] +BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[4] if not (USERNAME and BROWSERSTACK_ACCESS_KEY): raise Exception("Please provide your BrowserStack username and access key") - sys.exit(1) class PythonOrgSearch(unittest.TestCase): diff --git a/parallel_tests/README.md b/parallel_tests/README.md index c0bfad3..04260ba 100644 --- a/parallel_tests/README.md +++ b/parallel_tests/README.md @@ -1,6 +1,8 @@ +# Parallel Testing on BrowserStack + This project contains 3 files. Each of the files is described below. -browsers.json - This file specifies the browser capabilites for the tests. Here, each test would be run in these two browsers. +`browsers.json` - This file specifies the browser capabilites for the tests. Here, each test would be run in these two browsers. [ { @@ -17,37 +19,9 @@ browsers.json - This file specifies the browser capabilites for the tests. Here, ] -test.py - This file contains the selenium test which would be run in each of the browsers specificed by "browsers.json". - - from selenium import webdriver - import sys, json - - json_name = sys.argv[1] - with open(json_name, "r") as f: - obj = json.loads(f.read()) - instance_caps= obj[int(sys.argv[2])] - print "Test "+sys.argv[2]+" started" - caps = {} - - # Mention any other capabilities required in the test - caps["browserstack.debug"] = "true" - caps["build"] = "parallel tests" - - caps = dict(caps.items() + instance_caps.items()) - - # Sample selenium test - driver = webdriver.Remote( - command_executor='http://:@hub.browserstack.com/wd/hub', - desired_capabilities=caps) - - driver.get("http://www.google.com") - inputElement = driver.find_element_by_name("q") - inputElement.send_keys("browserstack") - inputElement.submit() - print driver.title - driver.quit() - -run_parallel_tests.py - This is the runner which runs the tests in parallel. +`test.py ` - This file contains the selenium test which would be run in each of the browsers specificed by "browsers.json". + +`run_parallel_tests.py ` - This is the runner which runs the tests in parallel. To run the tests in parallel execute the following command: diff --git a/parallel_tests/test.py b/parallel_tests/test.py index 6aeaf03..fa7708a 100644 --- a/parallel_tests/test.py +++ b/parallel_tests/test.py @@ -1,7 +1,9 @@ from selenium import webdriver -import sys, json +import os, sys, json json_name = sys.argv[1] +USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[2] +BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[3] with open(json_name, "r") as f: obj = json.loads(f.read()) @@ -23,8 +25,10 @@ # THE TEST TO BE RUN PARALLELY GOES HERE driver = webdriver.Remote( - command_executor='http://:@hub.browserstack.com/wd/hub', - desired_capabilities=caps) + command_executor='http://%s:%s@hub.browserstack.com/wd/hub' % ( + USERNAME, BROWSERSTACK_ACCESS_KEY + ), + desired_capabilities=caps) driver.get("http://www.google.com") inputElement = driver.find_element_by_name("q") diff --git a/py.test/README.md b/py.test/README.md new file mode 100644 index 0000000..23391ef --- /dev/null +++ b/py.test/README.md @@ -0,0 +1,12 @@ +# A sample to run py.test over BrowserStack Automate. + +## Setup + +`pip install pytest` + +## Execution +To run the tests, set correct environment variables or add you credentials to `google-search-browserstack.py` and execute: + +``` +py.test google-search-browserstack.py +``` diff --git a/py.test/README.mkd b/py.test/README.mkd deleted file mode 100644 index b85ed11..0000000 --- a/py.test/README.mkd +++ /dev/null @@ -1,7 +0,0 @@ -A sample to run py.test over BrowserStack Automate. - -To run the tests, add you credentials to `google-search-browserstack.py` and execute: - -``` -py.test google-search-browserstack.py -``` diff --git a/py.test/google-search-browserstack.py b/py.test/google-search-browserstack.py index 8fbc950..0a93724 100644 --- a/py.test/google-search-browserstack.py +++ b/py.test/google-search-browserstack.py @@ -1,13 +1,15 @@ +import os +import sys + from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # Edit these to match your credentials -USERNAME = None -BROWSERSTACK_ACCESS_KEY = None +USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[1] +BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[2] if not (USERNAME and BROWSERSTACK_ACCESS_KEY): raise Exception("Please provide your BrowserStack username and access key") - sys.exit(1) def test_run(): url = "http://%s:%s@hub.browserstack.com/wd/hub" %( diff --git a/unittest/google-search-browserstack.py b/unittest/google-search-browserstack.py index 18ddc30..8695749 100644 --- a/unittest/google-search-browserstack.py +++ b/unittest/google-search-browserstack.py @@ -1,3 +1,4 @@ +import os import sys import unittest @@ -6,8 +7,8 @@ from selenium.webdriver.common.desired_capabilities import DesiredCapabilities try: - USERNAME = sys.argv[1] - BROWSERSTACK_ACCESS_KEY = sys.argv[2] + USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[1] + BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[2] except IndexError: print("Please provide the username and browserstack access key as command line arguments.") sys.exit(1) From 8c1bb8eafebd72121535a0fa20a13ecba77ce6fa Mon Sep 17 00:00:00 2001 From: Varun Garg Date: Fri, 1 Mar 2019 17:15:51 +0530 Subject: [PATCH 2/3] Selenium 4 changes Signed-off-by: Varun Garg --- google-search-browserstack.py | 19 +++++++- nose-test/google-search-browserstack.py | 22 +++++++-- parallel_tests/README.md | 19 +------- parallel_tests/browsers.json | 61 +++++++++++++------------ parallel_tests/test.py | 21 +++------ py.test/google-search-browserstack.py | 31 +++++++++---- unittest/google-search-browserstack.py | 20 ++++++-- 7 files changed, 115 insertions(+), 78 deletions(-) diff --git a/google-search-browserstack.py b/google-search-browserstack.py index 005cb5a..738451b 100644 --- a/google-search-browserstack.py +++ b/google-search-browserstack.py @@ -7,16 +7,31 @@ try: USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[1] - BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[2] + BROWSERSTACK_ACCESS_KEY = os.environ.get( + 'BROWSERSTACK_ACCESS_KEY') or sys.argv[2] except IndexError: print("Pleaes provide the username and browserstack access key as command line arguments.") sys.exit(1) +capabilities = { + 'browserName': 'Firefox', + 'browserVersion': '65.0', + 'browserstack.use_w3c': 'true', + 'bstack:options': { + 'os': 'Windows', + 'buildName': 'automate-python-samples', + 'osVersion': '10', + 'sessionName': 'single_test', + 'projectName': 'Sample project', + 'debug': 'true' + } +} + driver = webdriver.Remote( command_executor='http://%s:%s@hub.browserstack.com/wd/hub' % ( USERNAME, BROWSERSTACK_ACCESS_KEY ), - desired_capabilities=DesiredCapabilities.FIREFOX + desired_capabilities = capabilities ) driver.get("http://www.google.com") diff --git a/nose-test/google-search-browserstack.py b/nose-test/google-search-browserstack.py index b82b4ae..1c7e9ab 100644 --- a/nose-test/google-search-browserstack.py +++ b/nose-test/google-search-browserstack.py @@ -8,21 +8,35 @@ # Edit these to match your credentials USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[3] -BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[4] +BROWSERSTACK_ACCESS_KEY = os.environ.get( + 'BROWSERSTACK_ACCESS_KEY') or sys.argv[4] if not (USERNAME and BROWSERSTACK_ACCESS_KEY): raise Exception("Please provide your BrowserStack username and access key") + class PythonOrgSearch(unittest.TestCase): def setUp(self): - url = "http://%s:%s@hub.browserstack.com/wd/hub" %( + url = "http://%s:%s@hub.browserstack.com/wd/hub" % ( USERNAME, BROWSERSTACK_ACCESS_KEY ) - + capabilities = { + 'browserName': 'Firefox', + 'browserVersion': '65.0', + 'browserstack.use_w3c': 'true', + 'bstack:options': { + 'os': 'Windows', + 'buildName': 'automate-python-samples', + 'osVersion': '10', + 'sessionName': 'nose_test', + 'projectName': 'Sample project', + 'debug': 'true' + } + } self.driver = webdriver.Remote( command_executor=url, - desired_capabilities=DesiredCapabilities.FIREFOX + desired_capabilities=capabilities ) def test_search_in_python_org(self): diff --git a/parallel_tests/README.md b/parallel_tests/README.md index 04260ba..22ac72b 100644 --- a/parallel_tests/README.md +++ b/parallel_tests/README.md @@ -4,24 +4,9 @@ This project contains 3 files. Each of the files is described below. `browsers.json` - This file specifies the browser capabilites for the tests. Here, each test would be run in these two browsers. - [ - { - "browserName": "iPhone", - "platform": "MAC", - "device": "iPhone 5" - }, - { - "browser": "firefox", - "browser_version": "17.0", - "os": "Windows", - "os_version": "8" - } - ] +`python test.py ` - This file contains the selenium test which would be run in each of the browsers specificed by "browsers.json". - -`test.py ` - This file contains the selenium test which would be run in each of the browsers specificed by "browsers.json". - -`run_parallel_tests.py ` - This is the runner which runs the tests in parallel. +`python run_parallel_tests.py ` - This is the runner which runs the tests in parallel. To run the tests in parallel execute the following command: diff --git a/parallel_tests/browsers.json b/parallel_tests/browsers.json index d501620..2e4d7d4 100644 --- a/parallel_tests/browsers.json +++ b/parallel_tests/browsers.json @@ -1,37 +1,40 @@ [ { - "browserName": "iPhone", - "platform": "MAC", - "device": "iPhone 5" + "browserName": "Firefox", + "browserVersion": "42.0", + "browserstack.use_w3c": true, + "bstack:options": { + "os": "OS X", + "osVersion": "Snow Leopard", + "sessionName": "parallel_test", + "buildName": "automate-python-samples", + "projectName": "Sample Project", + "debug": true + } }, { - "browser": "firefox", - "browser_version": "17.0", - "os": "Windows", - "os_version": "8" + "browserName": "Internet Explorer", + "browserVersion": "10", + "browserstack.use_w3c": true, + "bstack:options": { + "os": "Windows", + "sessionName": "parallel_test", + "buildName": "automate-python-samples", + "projectName": "Sample Project", + "debug": true + } }, { - "browser": "ie", - "browser_version": "8.0", - "os": "Windows", - "os_version": "7" - }, - { - "browser": "ie", - "browser_version": "9.0", - "os": "Windows", - "os_version": "7" - }, - { - "browser": "ie", - "browser_version": "10.0", - "os": "Windows", - "os_version": "8" - }, - { - "browser": "firefox", - "browser_version": "15.0", - "os": "OS X", - "os_version": "Snow Leopard" + "browserName": "Chrome", + "browserVersion": "70.0", + "browserstack.use_w3c": true, + "bstack:options": { + "os": "Windows", + "osVersion": "7", + "sessionName": "parallel_test", + "buildName": "automate-python-samples", + "projectName": "Sample Project", + "debug": true + } } ] diff --git a/parallel_tests/test.py b/parallel_tests/test.py index fa7708a..b93db97 100644 --- a/parallel_tests/test.py +++ b/parallel_tests/test.py @@ -1,26 +1,19 @@ from selenium import webdriver -import os, sys, json +import os +import sys +import json json_name = sys.argv[1] USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[2] -BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[3] +BROWSERSTACK_ACCESS_KEY = os.environ.get( + 'BROWSERSTACK_ACCESS_KEY') or sys.argv[3] with open(json_name, "r") as f: obj = json.loads(f.read()) -instance_caps= obj[int(sys.argv[2])] +caps = obj[int(sys.argv[2])] print "Test "+sys.argv[2]+" started" -#------------------------------------------------------# -# Mention any other capabilities required in the test -caps = {} -caps["browserstack.debug"] = "true" -caps["build"] = "parallel tests" - -#------------------------------------------------------# - -caps = dict(caps.items() + instance_caps.items()) - #------------------------------------------------------# # THE TEST TO BE RUN PARALLELY GOES HERE @@ -36,4 +29,4 @@ inputElement.submit() print driver.title driver.quit() -#------------------------------------------------------# \ No newline at end of file +#------------------------------------------------------# diff --git a/py.test/google-search-browserstack.py b/py.test/google-search-browserstack.py index 0a93724..e51a4a4 100644 --- a/py.test/google-search-browserstack.py +++ b/py.test/google-search-browserstack.py @@ -6,22 +6,37 @@ # Edit these to match your credentials USERNAME = os.environ.get('BROWSERSTACK_USERNAME') or sys.argv[1] -BROWSERSTACK_ACCESS_KEY = os.environ.get('BROWSERSTACK_ACCESS_KEY') or sys.argv[2] +BROWSERSTACK_ACCESS_KEY = os.environ.get( + 'BROWSERSTACK_ACCESS_KEY') or sys.argv[2] if not (USERNAME and BROWSERSTACK_ACCESS_KEY): raise Exception("Please provide your BrowserStack username and access key") + def test_run(): - url = "http://%s:%s@hub.browserstack.com/wd/hub" %( + url = "http://%s:%s@hub.browserstack.com/wd/hub" % ( USERNAME, BROWSERSTACK_ACCESS_KEY ) - - driver = webdriver.Remote(command_executor=url, desired_capabilities=DesiredCapabilities.FIREFOX) + capabilities = { + 'browserName': 'Firefox', + 'browserVersion': '65.0', + 'browserstack.use_w3c': 'true', + 'bstack:options': { + 'os': 'Windows', + 'buildName': 'automate-python-samples', + 'osVersion': '10', + 'sessionName': 'unittest_single_test', + 'projectName': 'Sample project', + 'debug': 'true' + } + } + driver = webdriver.Remote(command_executor=url, + desired_capabilities=capabilities) driver.get('http://www.google.com') if not "Google" in driver.title: raise Exception("Are you not on google? How come!") - elem = driver.find_element_by_name("q") - elem.send_keys("selenium") - elem.submit() - driver.quit() + elem = driver.find_element_by_name("q") + elem.send_keys("selenium") + elem.submit() + driver.quit() diff --git a/unittest/google-search-browserstack.py b/unittest/google-search-browserstack.py index 8695749..bf6fc07 100644 --- a/unittest/google-search-browserstack.py +++ b/unittest/google-search-browserstack.py @@ -19,10 +19,22 @@ def setUp(self): url = "http://%s:%s@hub.browserstack.com/wd/hub" %( USERNAME, BROWSERSTACK_ACCESS_KEY ) - + capabilities = { + 'browserName': 'Firefox', + 'browserVersion': '65.0', + 'browserstack.use_w3c': 'true', + 'bstack:options': { + 'os': 'Windows', + 'buildName': 'automate-python-samples', + 'osVersion': '10', + 'sessionName': 'unittest_single_test', + 'projectName': 'Sample project', + 'debug': 'true' + } + } self.driver = webdriver.Remote( command_executor=url, - desired_capabilities=DesiredCapabilities.FIREFOX + desired_capabilities=capabilities ) def test_search_in_python_org(self): @@ -33,8 +45,8 @@ def test_search_in_python_org(self): elem.submit() self.assertIn("Google", driver.title) - def tearDown(self): - self.driver.quit() + def tearDown(self): + self.driver.quit() if __name__ == "__main__": unittest.main(argv=sys.argv[:1]) From e799b12506c8448cee2069ada5eb6aabfa467216 Mon Sep 17 00:00:00 2001 From: francisf Date: Tue, 5 Mar 2019 11:57:34 +0530 Subject: [PATCH 3/3] Apply suggestions from code review Co-Authored-By: Varun-garg --- .vscode/settings.json | 2 +- google-search-browserstack.py | 2 +- nose-test/google-search-browserstack.py | 2 +- parallel_tests/test.py | 2 +- py.test/google-search-browserstack.py | 2 +- unittest/google-search-browserstack.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4e1520b..67c7ba9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "python.linting.pylintEnabled": true, "python.pythonPath": "/usr/local/bin/python" -} \ No newline at end of file +} diff --git a/google-search-browserstack.py b/google-search-browserstack.py index 738451b..6801532 100644 --- a/google-search-browserstack.py +++ b/google-search-browserstack.py @@ -28,7 +28,7 @@ } driver = webdriver.Remote( - command_executor='http://%s:%s@hub.browserstack.com/wd/hub' % ( + command_executor='https://%s:%s@hub.browserstack.com/wd/hub' % ( USERNAME, BROWSERSTACK_ACCESS_KEY ), desired_capabilities = capabilities diff --git a/nose-test/google-search-browserstack.py b/nose-test/google-search-browserstack.py index 1c7e9ab..3e99dd7 100644 --- a/nose-test/google-search-browserstack.py +++ b/nose-test/google-search-browserstack.py @@ -18,7 +18,7 @@ class PythonOrgSearch(unittest.TestCase): def setUp(self): - url = "http://%s:%s@hub.browserstack.com/wd/hub" % ( + url = "https://%s:%s@hub.browserstack.com/wd/hub" % ( USERNAME, BROWSERSTACK_ACCESS_KEY ) capabilities = { diff --git a/parallel_tests/test.py b/parallel_tests/test.py index b93db97..765101a 100644 --- a/parallel_tests/test.py +++ b/parallel_tests/test.py @@ -18,7 +18,7 @@ # THE TEST TO BE RUN PARALLELY GOES HERE driver = webdriver.Remote( - command_executor='http://%s:%s@hub.browserstack.com/wd/hub' % ( + command_executor='https://%s:%s@hub.browserstack.com/wd/hub' % ( USERNAME, BROWSERSTACK_ACCESS_KEY ), desired_capabilities=caps) diff --git a/py.test/google-search-browserstack.py b/py.test/google-search-browserstack.py index e51a4a4..2e18a64 100644 --- a/py.test/google-search-browserstack.py +++ b/py.test/google-search-browserstack.py @@ -14,7 +14,7 @@ def test_run(): - url = "http://%s:%s@hub.browserstack.com/wd/hub" % ( + url = "https://%s:%s@hub.browserstack.com/wd/hub" % ( USERNAME, BROWSERSTACK_ACCESS_KEY ) capabilities = { diff --git a/unittest/google-search-browserstack.py b/unittest/google-search-browserstack.py index bf6fc07..8f3ec80 100644 --- a/unittest/google-search-browserstack.py +++ b/unittest/google-search-browserstack.py @@ -16,7 +16,7 @@ class PythonOrgSearch(unittest.TestCase): def setUp(self): - url = "http://%s:%s@hub.browserstack.com/wd/hub" %( + url = "https://%s:%s@hub.browserstack.com/wd/hub" %( USERNAME, BROWSERSTACK_ACCESS_KEY ) capabilities = {