selenium中模拟鼠标,键盘操作

首先要重写一个WebDriverEventListener的接口类

1.模拟鼠标操作

EventFiringMouse mouse = new EventFiringMouse(driver, webDriverEventListener);
EventFiringTouch touch = new EventFiringTouch(driver, webDriverEventListener);

2.模拟键盘操作

EventFiringKeyboard keyboard = new EventFiringKeyboard(driver, webDriverEventListener);

 

 

你可能感兴趣的:(selenium)