From 73a7ac10cc945c75b1e61b25c83f6581e68e2a6e Mon Sep 17 00:00:00 2001 From: perforce-prasant Date: Wed, 21 Dec 2022 22:58:37 +0530 Subject: [PATCH] Fix for Issue where framework always tries to create Edge driver. --- pom.xml | 2 +- .../qmetry/qaf/automation/ui/UiDriverFactory.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index decb8e9..474ca4e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.quantum quantum-support - 1.30.0 + 1.30.1 UTF-8 diff --git a/src/main/java/com/qmetry/qaf/automation/ui/UiDriverFactory.java b/src/main/java/com/qmetry/qaf/automation/ui/UiDriverFactory.java index a93bd78..c6449c3 100644 --- a/src/main/java/com/qmetry/qaf/automation/ui/UiDriverFactory.java +++ b/src/main/java/com/qmetry/qaf/automation/ui/UiDriverFactory.java @@ -397,13 +397,22 @@ private DesiredCapabilities getDesiredCapabilities() { String driverCapKey = String.format(ApplicationProperties.DRIVER_CAPABILITY_PREFIX_FORMAT.key, browserName); config = ConfigurationManager.getBundle().subset(driverCapKey); + + // ======== Patch for Appium 2.0 and Selenium 4 vendor specific prefix ======== QuantumPatch quantumPatch = new QuantumPatch(); - Platform platform = desiredCapabilities.getPlatformName(); + String platform = (String)capabilities.get("platformName"); + + platform = (null == platform? null:platform.toUpperCase()); + + if(null == platform) { + platform = (String)config.getProperty("driverClass"); + platform = (null == platform? "WEB-PLATFORM":platform); + } - if(Platform.ANDROID.equals(platform) || Platform.IOS.equals(platform)) { + if(platform.contains("ANDROID") || platform.contains("IOS")) { quantumPatch.capabilitiesPatchAppium2(config, capabilities); }else { quantumPatch.capabilitiesPatchSelenium4(config, capabilities);