Need help in automating my use case using selenium
My Usecase to automate
I tried the following two approaches
Approach#1 : ( With this there is no change in zoom setting and script failed )
mysavelement.sendKeys(Keys.chord(Keys.CONTROL, Keys.SUBTRACT));
mysavelement.click();
mysavelement.sendKeys(Keys.chord(Keys.CONTROL, "0"));
Approach#2 : ( With this approach zoom setting got changed and script passed. Though script passed, click functionality is not working means save not happening )
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_SUBTRACT);
mysavelement.click();
I too have experienced click functionality sometimes failing on chrome browser when I try to zoom-in/out the browser. But, for firefox, it works fine. I don't know the reason for such a behavior, but javascript click workaround helped in such scenarios. Try, below work-around if not already tried:
(JavascriptExecutor)driver.executeScript("arguments[0].click();", mysavelement);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.