List of usage examples for org.openqa.selenium Point Point
public Point(int x, int y)
From source file:com.smash.revolance.ui.comparator.ElementMatchMakerTests.java
License:Open Source License
private static ElementBean buildElement(String impl, String txt, int x, int y, int w, int h, String caption) { ElementBean element = new ElementBean(); element.setImpl(impl);/* w ww . ja va 2s. co m*/ element.setText(txt); element.setPos(new Point(x, y)); element.setDim(new Dimension(w, h)); element.setCaption(caption); return element; }
From source file:com.smash.revolance.ui.materials.mock.webdriver.browser.MockedBrowser.java
License:Open Source License
public void setLocation(int x, int y) { location = new Point(x, y); }
From source file:com.smash.revolance.ui.materials.mock.webdriver.MockedWebPage.java
License:Open Source License
public Point getElementLocation(String elementId) { MockedWebElement element = getElement(elementId); return new Point(element.getX(), element.getY()); }
From source file:com.smash.revolance.ui.model.element.api.ElementBean.java
License:Open Source License
public Point getPos() { return new Point(x, y); }
From source file:com.smash.revolance.ui.model.element.api.ElementBean.java
License:Open Source License
/** * For convenience, retrieve the center of this element * * @return the center Point of this element *//*w ww.java 2s. c om*/ public Point getCenter() { Rectangle area = getLocation(); return new Point((int) area.getCenterX(), (int) area.getCenterY()); }
From source file:com.sonar.it.jenkins.orchestrator.JenkinsOrchestrator.java
License:Open Source License
public void start() { if (started.getAndSet(true)) { throw new IllegalStateException("Jenkins is already started"); }//ww w .j a va2s.c om int port = config.getInt("jenkins.container.port", 0); if (port <= 0) { port = NetworkUtils.getNextAvailablePort(); } distribution.setPort(port); FileSystem fileSystem = config.fileSystem(); ServerInstaller serverInstaller = new ServerInstaller(fileSystem); server = serverInstaller.install(distribution); server.setUrl(String.format("http://localhost:%d", port)); jenkinsWrapper = new JenkinsWrapper(server, config, fileSystem.javaHome(), port); jenkinsWrapper.start(); FirefoxProfile profile = new FirefoxProfile(); // Disable native events on all OS to avoid strange characters when using sendKeys profile.setEnableNativeEvents(false); driver = new FirefoxDriver(profile); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get(server.getUrl()); // Fix window size for having reproducible test behavior driver.manage().window().setPosition(new Point(20, 20)); driver.manage().window().setSize(new Dimension(1024, 768)); try { cli = new CLI(new URL(server.getUrl())); } catch (Exception e) { throw new RuntimeException(e); } }
From source file:com.tascape.qa.th.webui.comm.WebBrowser.java
License:Apache License
public void landscape() { this.manage().window().setPosition(new Point(0, 0)); this.manage().window().setSize(new Dimension(WIDTH, HEIGHT)); }
From source file:com.tascape.qa.th.webui.comm.WebBrowser.java
License:Apache License
public void portrait() { this.manage().window().setPosition(new Point(0, 0)); this.manage().window().setSize(new Dimension(HEIGHT, WIDTH)); }
From source file:com.tascape.qa.th.webui.comm.WebBrowser.java
License:Apache License
public void hide() { this.manage().window().setPosition(new Point(WIDTH, WIDTH)); }
From source file:com.vaadin.addon.spreadsheet.elements.AddressUtil.java
License:Open Source License
/** * Converts a single cell address to its integer coordinates (Point) * // www . j a va 2s. co m * @param address * The address of the cell, e.g. A3 * @return the coordinates of the cell */ public static Point addressToPoint(String address) { Matcher m = ADDRESS_PATTERN.matcher(address); m.find(); int col = charAddressToInt(m.group(1)); int row = Integer.valueOf(m.group(2)); return new Point(col, row); }