I have a unique requirement where I need to click on an object when the browser is zoomed out to 45%. Standard obj interaction doesnot work in selenium because the objects cant be viewed well in browser zoomed out state. Here are all things I tried
using selenium webdriver - clicking on popup with default button (Confirm) to be clicked so that default sendkeys can be sent
driver.findElement(By.xpath("//div[@ng-if='matchClass']")).click();
using selenium webdriver - Sending keys to active element.
driver.switchTo().activeElement().sendKeys(Keys.RETURN);
using selenium webdriver - Sending keys to active element.
driver.switchTo().activeElement().sendKeys(Keys.ENTER);
using selenium webdriver - Clicking on confirm button.
driver.findElement(By.xpath("//div[@class='modal-content']//button[contains(text(),'Confirm')]")).click();
using selenium webdriver - click on 'Confirm' button through javascript executor
WebElement 'Confirm'= driver.findElement(By.xpath("//div[@class='modal-content']//button[contains(text(),'Confirm')]"));
JavascriptExecutor js1 = (JavascriptExecutor) driver;
js1.executeScript("arguments[0].doubleClick();", 'Confirm')Using SendKeys
SendKeys (Keys.ENTER)
used robot class to send keys, did not work.
I tried everything I possibly could. I cant zoom in and perform action because that will make other threads looking at other objects on the page fail, thus failing threads. Is there a solution that enables the user to send keyboard inputs without using object references and just sendkeys in java?