WebDriver action classes do not execute while inside an iframe within the Microsoft Edge browser

Issue #16424557 • Assigned to Steven K.

Details

Author
Franco D.
Created
Mar 16, 2018
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

I am using Windows 10 Build 10586. I have installed Microsoft Edge WebDriver Release 10586

The following action classes do not get executed while inside an iframe within the Microsoft Edge browser:
action.dragAndDrop
action.doubleClick
action.contextClick
action.clickAndHold
action.moveToElement
action.release

Here are the sample programs where I’ve tried to execute these actions:

Program 1:

package trainingSeleniumAutomation;

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.interactions.Actions;

public class ActionsClassEdge {

public static void main(String[] args) throws InterruptedException, AWTException {
    // TODO Auto-generated method stub

    //Initiate Browser
    System.setProperty("webdriver.edge.driver", "C:\\MicrosoftEdge\\MicrosoftWebDriver.exe");
    
    WebDriver driver = new EdgeDriver();
    driver.manage().window().maximize();
    
    Actions action = new Actions(driver);
    
    driver.get("https://jqueryui.com/droppable/");
    
    Thread.sleep(1000);
    
    driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    
            
    driver.switchTo().frame(0);
    
    
    Thread.sleep(1000);
    
    
    WebElement drag=driver.findElement(By.xpath("//*[@id='draggable']"));
      
    
            WebElement drop=driver.findElement(By.xpath("//*[@id='droppable']"));
    
    
    Thread.sleep(1000);
    
        
    action.dragAndDrop(drag, drop).build().perform();
            
}

}

Program 2:

package trainingSeleniumAutomation;

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Collections;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.interactions.Actions;

public class ActionsClassEdge1a {

public static void main(String[] args) throws InterruptedException, AWTException {
    // TODO Auto-generated method stub

    //Initiate Browser
           System.setProperty("webdriver.edge.driver", "C:\\MicrosoftEdge\\MicrosoftWebDriver.exe");
    
    WebDriver driver = new EdgeDriver();
    driver.manage().window().maximize();
    
    Actions action = new Actions(driver);
    
    driver.get("https://jqueryui.com/droppable/");
    
    driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    
    driver.switchTo().frame(0);
    
    WebElement drag = driver.findElement(By.id("draggable"));

    WebElement drop = driver.findElement(By.id("droppable"));
    
            
    action.doubleClick(drag);
    
    Thread.sleep(1000);
    
            
    action.contextClick(drop);
    
    
    Thread.sleep(1000);
    
    
            
    action.dragAndDrop(drag, drop).perform();
    
    
    
}

}

Program 3:

package trainingSeleniumAutomation;

import java.util.Collections;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.interactions.Actions;

public class ActionsClassEdge2a {

public static void main(String[] args) throws InterruptedException {
    // TODO Auto-generated method stub

    //Initiate Browser
            System.setProperty("webdriver.edge.driver", "C:\\MicrosoftEdge\\MicrosoftWebDriver.exe");
    
    WebDriver driver = new EdgeDriver();
    driver.manage().window().maximize();
    
    Actions action = new Actions(driver);
            
    driver.get("https://jqueryui.com/droppable/");
    
    driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    
    driver.switchTo().frame(0);
    
    WebElement drag = driver.findElement(By.id("draggable"));

    WebElement drop = driver.findElement(By.id("droppable"));
    
    action.clickAndHold(drag).moveToElement(drop).release(drop).build().perform();
    
    //driver.quit();
    
    
}

}

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

  • Hi Franco,

    Are you still seeing this issue?  I test the drag and drop method you provided and the drag and drop was successful.  I have attached my repro.zip.  I.e. your code with an extra wait to view the final drop take place.

    What errors are you seeing?  If you use my repro you will be able to see debug logging and see where the commands are failing.  I.e. I created a console java app.  My version assumes the MicrosoftWebDriver.exe is in your PATH.

    Here are the steps to run:

    open gitbash to webdriverjavaextensionapp folder

    change to he directory containing the pom.xml file

    C:\code\webdriverjavaextensionsapp

    BUILD

    mvn clean compile package

    run

    java -jar target/AppFatJar-1.0-SNAPSHOT-spring-boot.jar

You need to sign in to your Microsoft account to add a comment.

Sign in