Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Actions.click()


        // following tests usage of Actions with injected plain WebElement
        builder.click(input);
        // following with List<WebElement>
        builder.click(divs.get(0));
        // following with WebElements from Page Fragments
        builder.click(abstractPageFragmentStub.getLocatorRefByXPath());
        // following with List of WebElements from Page Fragments
        builder.click(abstractPageFragmentStub.getSpansInPageFragment().get(0));

        builder.perform();
    }
View Full Code Here


        // following with List<WebElement>
        builder.click(divs.get(0));
        // following with WebElements from Page Fragments
        builder.click(abstractPageFragmentStub.getLocatorRefByXPath());
        // following with List of WebElements from Page Fragments
        builder.click(abstractPageFragmentStub.getSpansInPageFragment().get(0));

        builder.perform();
    }

    @Test
View Full Code Here

        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);
    }
}
View Full Code Here

        element = findElementById("label1");

        final Actions actions = new Actions(webDriver);
        actions.moveToElement(element).build().perform();
        actions.click().build().perform();

        final PValueChangeEvent<Date> e2 = eventsListener.poll();
        Assert.assertEquals("2012-10-30", dateFormat.format(e2.getValue()));
        Assert.assertEquals("2012-10-30", dateBox1.getDisplayedValue());
    }
View Full Code Here

        actions.moveToElement(focusPanel1).build().perform();
        final PMouseOverEvent e1 = eventsListener.poll();
        Assert.assertNotNull(e1);

        // Focus
        actions.click().build().perform();
        final PFocusEvent e2 = eventsListener.poll();
        Assert.assertNotNull(e2);

        // Key press/ Key up
        actions.sendKeys("a").build().perform();
View Full Code Here

        if (selection.size() > 1) {
            //multiple selection is not working
            Actions builder = new Actions(driver);
            boolean firstrun = true;
            for (WebElement keyElement : selection) {
                builder.click(keyElement);//also deselect previous selected elements
                if (firstrun) {
                    firstrun = false;
                    builder.keyDown(Keys.CONTROL);
                }
            }
View Full Code Here

        Actions actionBuilder = new Actions(d);

        d.get("http://www.duckduckgo.com");

        // Left click
        actionBuilder.click().build().perform();
        // Right click
        actionBuilder.contextClick(null).build().perform();
        // Right click on the logo (it will cause a "/moveto" before clicking
        actionBuilder.contextClick(d.findElement(By.id("logo_homepage_link"))).build().perform();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.