From 34bb0f9886102517ca8d6586abc14dfc03dc6e5c Mon Sep 17 00:00:00 2001 From: A247ZG Date: Wed, 4 Oct 2023 15:24:38 +0200 Subject: [PATCH] Fix bug iframe --- .../axa/automation/webengine/cmd/SwitchFrameCommand.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webengine-drive-by-excel/src/main/java/fr/axa/automation/webengine/cmd/SwitchFrameCommand.java b/webengine-drive-by-excel/src/main/java/fr/axa/automation/webengine/cmd/SwitchFrameCommand.java index 811c310..f5d10fa 100644 --- a/webengine-drive-by-excel/src/main/java/fr/axa/automation/webengine/cmd/SwitchFrameCommand.java +++ b/webengine-drive-by-excel/src/main/java/fr/axa/automation/webengine/cmd/SwitchFrameCommand.java @@ -2,10 +2,10 @@ import fr.axa.automation.webengine.global.AbstractGlobalApplicationContext; import fr.axa.automation.webengine.global.AbstractTestCaseContext; -import fr.axa.automation.webengine.global.TestCaseNoCodeContext; import fr.axa.automation.webengine.object.CommandDataNoCode; import fr.axa.automation.webengine.object.CommandResult; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; import java.util.List; @@ -13,10 +13,11 @@ public class SwitchFrameCommand extends AbstractDriverCommand{ @Override public void executeCmd(AbstractGlobalApplicationContext globalApplicationContext, AbstractTestCaseContext testCaseContext, CommandDataNoCode commandData, List commandResultList) throws Exception { - String value = getValue(globalApplicationContext, (TestCaseNoCodeContext) testCaseContext, commandData, commandResultList); + webElementDescription = populateWebElement(globalApplicationContext,testCaseContext,commandData,commandResultList); WebDriver webDriver = getWebDriverToUse(globalApplicationContext,testCaseContext,commandResultList); if (webDriver != null) { - webDriver.switchTo().frame(value); + WebElement webElement = webElementDescription.findElement(); + webDriver.switchTo().frame(webElement); } } }