thank you for helping in advance.
I have the below simple selenium code, to draw a line on the canvas.
System.setProperty("webdriver.chrome.driver", "assets\\drivers\\chromedriver_94.exe");
// In the build.gradle
// implementation 'org.seleniumhq.selenium:selenium-java:3.141.59'
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setExperimentalOption("w3c", true);
WebDriver driver = new ChromeDriver(chromeOptions);
driver.manage().window().maximize();
driver.get("https://sketchtoy.com/");
// Canvas element
WebElement element = driver.findElement(By.xpath("//div[@class='sketch-canvas-container']/canvas"));
Actions builder = new Actions(driver);
builder.moveToElement(element, 10, 10).perform();
builder.clickAndHold().perform();
builder.moveByOffset(150, 50).perform();
builder.pause(5000).perform();
driver.quit();
When I run this code with w3c true, I get the below output,
And when I run the same code with w3c false, I get
Now the issue is when w3c is true, all the actions performed are from center of the canvas, i.e. the drawing starts from the center of the canvas and end also at the center of the canvas. But the same is not true in case w3c is false because in case w3c is false the start and end are on top left corner of the element.
I just wanted to understand, is this behavior of selenium w3c is intentional or it's a bug.
Any suggestion will be really helpful. Thank you again.
Created a issue with selenium github on the same. https://github.com/SeleniumHQ/selenium/issues/9965