Get Element Location關鍵字用來獲取一個Element的Location位置,該關鍵字接收一個參數[ locator ]html
示例1:使用Get Element Location來獲取一個EditText輸入框的Location位置,在這裏依舊採用上面使用的APP界面來作操做示例app
Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=22 deviceName=98YFBP522VSU app=C:/Users/yongqing/Desktop/app-debug.apk appPackage=com.example.calculator appActivity=MainActivity框架
${Location} Get Element Location id=com.example.calculator:id/factorone測試
log ${Location} ui
執行結果:debug
Starting test: RobotFrameworkTest1.TestSuite5.TestCase010orm
20170510 15:56:05.348 : INFO : msg:find id=com.example.calculator:id/factoronehtm
20170510 15:56:06.929 : INFO : Element 'id=com.example.calculator:id/factorone' location: {'y': 50, 'x': 0}blog
20170510 15:56:06.930 : INFO : ${Location} = {'y': 50, 'x': 0}get
20170510 15:56:06.932 : INFO : {'y': 50, 'x': 0}
Ending test: RobotFrameworkTest1.TestSuite5.TestCase010
從執行結果能夠看到,獲取到的Location結果爲{'y': 50, 'x': 0}
【原文歸做者全部,歡迎轉載,可是保留版權】