From 7a844a383a78ab3dbbe86bb646a5cf1f3cf572e8 Mon Sep 17 00:00:00 2001 From: Pawan Rai Date: Fri, 9 Feb 2024 18:50:41 +0530 Subject: [PATCH 1/3] minor fixes --- selenium/lambdatest_selenium_driver/smartui.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selenium/lambdatest_selenium_driver/smartui.py b/selenium/lambdatest_selenium_driver/smartui.py index 64e568a..f105aa0 100644 --- a/selenium/lambdatest_selenium_driver/smartui.py +++ b/selenium/lambdatest_selenium_driver/smartui.py @@ -7,12 +7,13 @@ def smartui_snapshot(driver, name,options={}): # setting up logger setup_logger() logger = get_logger() + + if not name: + raise Exception('The `snapshotName` argument is required.') + if is_smartui_enabled() is False: + raise Exception("Cannot find SmartUI server.") try: - if not name: - raise Exception('The `snapshotName` argument is required.') - if is_smartui_enabled() is False: - raise Exception("Cannot find SmartUI server.") resp = fetch_dom_serializer() driver.execute_script(resp['data']['dom']) From 9741cc0d31357c3ea77886c5fc5fe7d487fda1f7 Mon Sep 17 00:00:00 2001 From: Pawan Rai Date: Fri, 9 Feb 2024 19:44:44 +0530 Subject: [PATCH 2/3] minor fixes --- selenium/lambdatest_selenium_driver/smartui.py | 1 - 1 file changed, 1 deletion(-) diff --git a/selenium/lambdatest_selenium_driver/smartui.py b/selenium/lambdatest_selenium_driver/smartui.py index f105aa0..ab44f5a 100644 --- a/selenium/lambdatest_selenium_driver/smartui.py +++ b/selenium/lambdatest_selenium_driver/smartui.py @@ -14,7 +14,6 @@ def smartui_snapshot(driver, name,options={}): raise Exception("Cannot find SmartUI server.") try: - resp = fetch_dom_serializer() driver.execute_script(resp['data']['dom']) From 2d3ca55092441ac34a0f362e720e652f07aa002e Mon Sep 17 00:00:00 2001 From: Pawan Rai Date: Fri, 9 Feb 2024 19:57:43 +0530 Subject: [PATCH 3/3] minor fixes --- selenium/lambdatest_selenium_driver/smartui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selenium/lambdatest_selenium_driver/smartui.py b/selenium/lambdatest_selenium_driver/smartui.py index ab44f5a..5e8fd36 100644 --- a/selenium/lambdatest_selenium_driver/smartui.py +++ b/selenium/lambdatest_selenium_driver/smartui.py @@ -37,4 +37,5 @@ def smartui_snapshot(driver, name,options={}): logger.info(f'Snapshot captured {name}') except Exception as e: - logger.error(f'Could not take snapshot "{name}" Error {e}') \ No newline at end of file + logger.error(f'SmartUI snapshot failed "${name}"') + logger.error(e) \ No newline at end of file