Skip to content

Commit

Permalink
Fix bug iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharul82 committed Oct 4, 2023
1 parent 946238e commit 34bb0f9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

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;

public class SwitchFrameCommand extends AbstractDriverCommand{

@Override
public void executeCmd(AbstractGlobalApplicationContext globalApplicationContext, AbstractTestCaseContext testCaseContext, CommandDataNoCode commandData, List<CommandResult> 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);
}
}
}

0 comments on commit 34bb0f9

Please sign in to comment.