1. 程式人生 > >selenium中模擬滑鼠,鍵盤操作

selenium中模擬滑鼠,鍵盤操作

首先要重寫一個WebDriverEventListener的介面類

1.模擬滑鼠操作

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

2.模擬鍵盤操作

EventFiringKeyboard keyboard = new EventFiringKeyboard(driver, webDriverEventListener);