First identify the web element then use getLocation() method to get the location/position
WebDriver driver= new FirefoxDriver();
System.out.println(driver.findElement(By.name("username")).getLocation());
質問
I recently migrated from Selenium Rc to web driver i am using the method as follows public Number getCursorPosition(String locator)
how to implement that method by using selenium web driver. Thanks in advance.
解決
First identify the web element then use getLocation() method to get the location/position
WebDriver driver= new FirefoxDriver();
System.out.println(driver.findElement(By.name("username")).getLocation());