Package org.openqa.selenium

Examples of org.openqa.selenium.Point


        WebElement wnd = getDriver().findElement(By.id("topwindow"));
        // There is some bug in Selenium. Can't move window using header
        // need use footer instead.
        WebElement wnd1Footer = wnd
                .findElement(By.className("v-window-footer"));
        Point startLoc = wnd.getLocation();
        Coordinates footerCoordinates = ((Locatable) wnd1Footer)
                .getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseDown(footerCoordinates);
        mouse.mouseMove(footerCoordinates, 200, 200);
        mouse.mouseUp(footerCoordinates);
        Point endLoc = wnd.getLocation();
        // don't compare to specific coordinate, because in IE9 and IE11
        // the window position is random.
        // So, checkt that the window was moved
        org.junit.Assert.assertNotEquals(startLoc, endLoc);
    }
View Full Code Here


        openTestURL();

        WebElement element = driver.findElement(By
                .className("v-window-outerheader"));

        Point location = element.getLocation();

        element.click();

        new Actions(driver).moveToElement(element).perform();
        sleep(100);
        // move pointer bit right from the caption text
        new Actions(driver).moveByOffset(50, 0).clickAndHold()
                .moveByOffset(10, 2).moveByOffset(10, 0).moveByOffset(10, 0)
                .moveByOffset(10, 0).release().perform();

        String selection = ((JavascriptExecutor) getDriver()).executeScript(
                "return document.getSelection().toString();").toString();

        Assert.assertTrue("Text selection was not empty:" + selection,
                selection.isEmpty());

        // Verify also that window was really moved
        Point location2 = element.getLocation();
        Assert.assertEquals(location.getX() + (4 * 10), location2.getX());

    }
View Full Code Here

        // I'd loved to use the header, but that doesn't work. Footer works
        // fine, though :)
        WebElement windowFooter = getDriver().findElement(
                By.className("v-window-footer"));

        final Point winPos = window.getLocation();

        // move window
        Action a = new Actions(driver).clickAndHold(windowFooter)
                .moveByOffset(100, 100).release().build();
        a.perform();
View Full Code Here

        TestBenchElement tab = (TestBenchElement) getDriver().findElement(
                By.className("v-tabsheet-tabitemcell"));
        tab.click(10, 10);

        Point oldLocation = tab.getLocation();

        tab.sendKeys(Keys.SPACE);

        Point newLocation = tab.getLocation();

        Assert.assertEquals(oldLocation, newLocation);
    }
View Full Code Here

        }

        Thread.sleep(1000);

        // Get location of item 40
        Point item40Location = getTreeNode("Node 40").getLocation();

        // Right click on item 45
        WebElement item45 = getTreeNode("Node 45");
        new Actions(getDriver()).moveToElement(item45).contextClick(item45)
                .perform();

        // Ensure location of item 40 is still the same (no scrolling)
        Point item40Location2 = getTreeNode("Node 40").getLocation();
        assertEquals(item40Location.getY(), item40Location2.getY());
    }
View Full Code Here

    @Test
    public void test() {
        openTestURL();
        WebElement element = getDriver().findElement(
                By.id(HorizontalLayoutFullsizeContentWithErrorMsg.FIELD_ID));
        Point location = element.getLocation();

        WebElement errorToggleButton = getDriver().findElement(
                By.id(HorizontalLayoutFullsizeContentWithErrorMsg.BUTTON_ID));

        errorToggleButton.click();
View Full Code Here

        Assert.assertNotNull(notification);
        String left = notification.getCssValue("left");
        Assert.assertEquals(
                "Left position of notification element should be 0px", "0px",
                left);
        Point location = notification.getLocation();
        Assert.assertEquals("X coordinate of notifiation element should be 0",
                0, location.getX());

        WebElement body = driver.findElement(By.tagName("body"));
        int height = body.getSize().height;

        Assert.assertTrue("Y coordinate of notification element is too small",
                height / 2 - notification.getSize().height / 2 - 1 <= location
                        .getY());
        Assert.assertTrue("Y coordinate of notification element is too big",
                height / 2 + 1 >= location.getY());
    }
View Full Code Here

        WebElement body = driver.findElement(By.tagName("body"));
        int height = body.getSize().height;
        int width = body.getSize().width;

        Point location = notification.getLocation();
        Assert.assertTrue(
                "Notification right border should be in the rightmost position",
                width - 1 <= location.getX()
                        + notification.getSize().getWidth());

        Assert.assertTrue("Y coordinate of notification element is too small",
                height / 2 - notification.getSize().height / 2 - 1 <= location
                        .getY());
        Assert.assertTrue("Y coordinate of notification element is too big",
                height / 2 + 1 >= location.getY());
    }
View Full Code Here

        }
        actions.build().perform();

        Graphene.waitGui().withTimeout(2, TimeUnit.SECONDS).until().element(contextMenuPopup).is().visible();

        Point locationOfTarget = target.getLocation();
        Point locationOfCtxMenu = contextMenuPopup.getLocation();

        double witdth = getTargetWidth(target);
        double height = getTargetHeight(target);

        double halfOfDiagonal = Math.sqrt((height * height) + (witdth * witdth)) / 2.0;
View Full Code Here

    driver = getDriver(SampleApps.ppNQASampleAppCap());
  }

  @Test
  public void testPinchClose() {
    Point closeFrom = new Point(756, 612);
    Point closeTo = new Point(856, 612);

    IOSTouchScreen iosTouchScreen = IOSDriverAugmenter.augment(driver);
    iosTouchScreen.pinchCloseFromToForDuration(closeFrom, closeTo, 3);

    waitForElement(driver,
View Full Code Here

TOP

Related Classes of org.openqa.selenium.Point

Copyright © 2018 www.massapicom. 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.