I am trying to get the co-ordinates of a selected object.
My code is as follows:
WebElement obj=driver.switchTo().activeElement();
Point p=obj.getLocation();
int x=p.getX();
int y=p.getY();
Log.info("X co-pordinate is:"+x+" Y co=ordinate is:"+y);
I have used driver.switchTo().activeElement() because UIspy is not recognizing the object.
This code is giving me null pointer as follows:
org.openqa.selenium.UnsupportedCommandException: 'getElementLocation' is not valid or implemented command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'xyz', ip: '10.65.166.243', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.winium.WiniumDriver
Capabilities [{app=C:\Informatica1041\10.4.1\clients\PowerCenterClient\client\bin\pmwflmgr.exe, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}]
Session ID: AwesomeSession
Can anyone please let me know how we can get the co-ordinates of selected object?
I am trying to get the co-ordinates of a selected object.
My code is as follows: WebElement obj=driver.switchTo().activeElement(); Point p=obj.getLocation(); int x=p.getX(); int y=p.getY(); Log.info("X co-pordinate is:"+x+" Y co=ordinate is:"+y);
I have used driver.switchTo().activeElement() because UIspy is not recognizing the object.
This code is giving me null pointer as follows: org.openqa.selenium.UnsupportedCommandException: 'getElementLocation' is not valid or implemented command. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 16 milliseconds Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'xyz', ip: '10.65.166.243', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161' Driver info: org.openqa.selenium.winium.WiniumDriver Capabilities [{app=C:\Informatica1041\10.4.1\clients\PowerCenterClient\client\bin\pmwflmgr.exe, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}] Session ID: AwesomeSession
Can anyone please let me know how we can get the co-ordinates of selected object?