@Test public void testActionsProviderLookup() { // having ActionsProvider provider = new ActionsProvider(); Mouse mouse = mock(Mouse.class); Keyboard keyboard = mock(Keyboard.class); when(((HasInputDevices) driver).getMouse()).thenReturn(mouse); when(((HasInputDevices) driver).getKeyboard()).thenReturn(keyboard); // when Actions actions = (Actions) provider.lookup(null, null); actions.click().perform(); // then verify(mouse).click(null); verifyNoMoreInteractions(mouse, keyboard); } }