I was going through the selenium learning and when I was exploring interaction with keyboard and mouse topic, I found this code.
With the help of Robot class,perform Enter :
Robot r=new Robot();
r.keyPress(KeyEvent.VK_ENTER);
With the help of Actions class,perform Enter :
Actions action = new Actions(driver);
action.sendKeys(Keys.ENTER).build().perform();
Why do we need both the class to perform same actions? What is the difference between Robot class and Actions class?
TIA.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…