Skip to content

[πŸ› Bug]: Click & Sendkeys using BiDi is not working on iFrameΒ #16409

@PrasathB-27

Description

@PrasathB-27

Description

When trying to click/sendkey an element inside an iFrame using Selenium BiDi's input.perform(driver.getWindowHandle(), sequence), exception throws.

  1. Selenium points to the top level of the browser even after switch to iframe using traditional method 'driver.switchTo().frame'.
  2. I couldn't find the alternative to work on iframe.

Reproducible Code

try {

FirefoxOptions options = new FirefoxOptions();
options.setBrowserVersion("140.0");
options.setCapability("webSocketUrl", true);
WebDriver driver = new FirefoxDriver(options);

driver.navigate().to("https://seleniumbase.io/demo_page");	
WebElement element = driver.findElement(By.cssSelector("#myFrame3"));
BrowsingContext parentContext = new BrowsingContext(driver, driver.getWindowHandle());
driver.switchTo().frame(element);
WebElement checkbox = driver.findElement(By.cssSelector("#checkBox6"));
Actions actions = new Actions(driver);
Input input = new Input(driver);
actions.moveToElement(checkbox).click();
input.perform(parentContext.getId(),actions.getSequences());
input.release(parentContext.getId());

}catch(Exception e) {
e.printStackTrace();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-javaJava BindingsD-firefoxI-defectSomething is not working as intendedOS-mac

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions