Java Code Examples for org.openqa.selenium.WebDriver.Window#getPosition()
The following examples show how to use
org.openqa.selenium.WebDriver.Window#getPosition() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaDriverTest.java From marathonv5 with Apache License 2.0 | 6 votes |
public void windowPosition() throws Throwable { driver = new JavaDriver(); SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame.setLocationRelativeTo(null); frame.setVisible(true); } }); Window window = driver.manage().window(); Point actual = window.getPosition(); AssertJUnit.assertNotNull(actual); java.awt.Point expected = EventQueueWait.call(frame, "getLocation"); AssertJUnit.assertEquals(expected.x, actual.x); AssertJUnit.assertEquals(expected.y, actual.y); }
Example 2
Source File: JavaDriverTest.java From marathonv5 with Apache License 2.0 | 6 votes |
public void windowSetPosition() throws Throwable { driver = new JavaDriver(); SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame.setLocationRelativeTo(null); frame.setVisible(true); } }); Window window = driver.manage().window(); Point actual = window.getPosition(); AssertJUnit.assertNotNull(actual); java.awt.Point expected = EventQueueWait.call(frame, "getLocation"); AssertJUnit.assertEquals(expected.x, actual.x); AssertJUnit.assertEquals(expected.y, actual.y); window.setPosition(new Point(expected.x + 10, expected.y + 10)); actual = window.getPosition(); AssertJUnit.assertEquals(expected.x + 10, actual.x); AssertJUnit.assertEquals(expected.y + 10, actual.y); }