From 51881a8d0da845176091784deede03ede23bedc1 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Mon, 19 Jun 2023 12:01:10 +0530 Subject: [PATCH 1/2] Added sessionName --- tests/local-test.py | 2 +- tests/test.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/local-test.py b/tests/local-test.py index 5271b2b..0a324b6 100644 --- a/tests/local-test.py +++ b/tests/local-test.py @@ -3,7 +3,7 @@ from selenium.webdriver.chrome.options import Options as ChromeOptions options = ChromeOptions() - +options.set_capability('sessionName', 'BStack Local Test') # The webdriver management will be handled by the browserstack-sdk # so this will be overridden and tests will run browserstack - # without any changes to the test files! diff --git a/tests/test.py b/tests/test.py index 0426dba..c242b14 100644 --- a/tests/test.py +++ b/tests/test.py @@ -4,11 +4,14 @@ from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.chrome.options import Options as ChromeOptions # The webdriver management will be handled by the browserstack-sdk # so this will be overridden and tests will run browserstack - # without any changes to the test files! -driver = webdriver.Chrome() +options = ChromeOptions() +options.set_capability('sessionName', 'BStack Sample Test') +driver = webdriver.Chrome(options=options) try: driver.get('https://bstackdemo.com/') From 7f6aff39837db80707a7017cf4a23e99e9911256 Mon Sep 17 00:00:00 2001 From: Neha Agarwal Date: Mon, 19 Jun 2023 12:02:18 +0530 Subject: [PATCH 2/2] small fix --- tests/local-test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/local-test.py b/tests/local-test.py index 0a324b6..2478a77 100644 --- a/tests/local-test.py +++ b/tests/local-test.py @@ -4,6 +4,7 @@ options = ChromeOptions() options.set_capability('sessionName', 'BStack Local Test') + # The webdriver management will be handled by the browserstack-sdk # so this will be overridden and tests will run browserstack - # without any changes to the test files!