From cca8bd4be355ec74e2be4ff3bbdd949e3c9ef062 Mon Sep 17 00:00:00 2001 From: Alvaro Laserna Date: Wed, 8 Oct 2025 10:51:51 +0300 Subject: [PATCH 1/3] remove chrome args for appium android --- testui/support/appium_driver.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/testui/support/appium_driver.py b/testui/support/appium_driver.py index ff80534..d245794 100644 --- a/testui/support/appium_driver.py +++ b/testui/support/appium_driver.py @@ -59,7 +59,6 @@ def __init__(self): self.process = None self.file_name = None self.__appium_log_file = "appium-stdout.log" - self.__chromedriverArgs = ["relaxed security"] self.__desired_capabilities = {} # TODO: Investigate if should be used in functionality or should be # removed. @@ -304,13 +303,6 @@ def __set_android_caps(self): """Set Android capabilities""" if self.__automation_name is None: self.__automation_name = "UiAutomator2" - self.__desired_capabilities["appium:chromeOptions"] = {"w3c": False} - # TODO: It is not being passed to executable. Tried this - # https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md - self.__desired_capabilities[ - "chromedriverArgs" - ] = self.__chromedriverArgs - self.__desired_capabilities["appium:chromeDriverPort"] = ( self.appium_port - 4723 + 8100 ) @@ -419,7 +411,6 @@ def start_driver(desired_caps, url, debug, port, udid, log_file): logger.log("starting appium driver...") process = None - options = None if "android" in desired_caps["platformName"].lower(): url, desired_caps, process, file = __local_run( url, desired_caps, port, udid, log_file From 44d4d3c100164916093437778f1fe577167a0b8e Mon Sep 17 00:00:00 2001 From: Alvaro Laserna Date: Wed, 8 Oct 2025 11:00:13 +0300 Subject: [PATCH 2/3] change version --- README.md | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d007804..b26fe14 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ Installation is a simple by the helps of `pip`, Py-TestUI can be installed using this `pip` command. ```bash -pip3 install python-testui==1.2.4 +pip3 install python-testui==1.2.5 ``` Or if you prefer `requirements.txt`, you can add the following dependency to the file. ```txt -python-testui==1.2.4 +python-testui==1.2.5 ``` # Appium driver diff --git a/setup.py b/setup.py index 96b9079..2f36dac 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="python-testui", - version="1.2.4", + version="1.2.5", description="Browser and Mobile automation framework", long_description=long_description, long_description_content_type="text/markdown", From e56a6a008c41eba4757547779d463948af2d27ab Mon Sep 17 00:00:00 2001 From: Alvaro Laserna Date: Wed, 8 Oct 2025 11:37:56 +0300 Subject: [PATCH 3/3] check appium is greater or equal than 2 --- testui/support/appium_driver.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/testui/support/appium_driver.py b/testui/support/appium_driver.py index d245794..530e505 100644 --- a/testui/support/appium_driver.py +++ b/testui/support/appium_driver.py @@ -580,9 +580,14 @@ def __local_run(url, desired_caps, use_port, udid, log_file): # Check Appium Version result = subprocess.run(["appium", "-v"], stdout=subprocess.PIPE).stdout url = f"http://localhost:{str(port)}/wd/hub" - if result.decode('utf-8').startswith("2."): - # for Appium version > 2.0.0 - url = f"http://localhost:{str(port)}" + result_text = result.decode('utf-8').strip() + try: + major = int(result_text.split('.')[0]) + except (ValueError, IndexError): + major = 0 + if major >= 2: + # for Appium version >= 2.0.0 + url = f"http://localhost:{port}" return url, desired_caps, process, file_path return url, desired_caps, None, None