Hi guys,
i am trying to Tap on one button which is there in middle of the screen for that button there is no element found in IOS mobile testing so i’m trying to tap by using tap at position but i’m unable to found that button x and y positions can anyone suggest me how to get that element x and y positions for IOS Thanks
Hi Shiva,
You could try to utilize the https://docs.katalon.com/katalon-studio/docs/spy-mobile-utility.html to create a relative xpath for the element.
find the element’s right position and left position and the top position will apply to all the screen device
left = Mobile.getElementLeftPosition(findTestObject(‘Object Repository/Purchase of objects/XCUIElementTypeStaticText - BBQ Chicken on Grill Regression Automation’),
0)
top = Mobile.getElementTopPosition(findTestObject(‘Object Repository/Purchase of objects/XCUIElementTypeStaticText - BBQ Chicken on Grill Regression Automation’), 0)
width = Mobile.getElementWidth(findTestObject(‘Object Repository/Purchase of objects/XCUIElementTypeStaticText - BBQ Chicken on Grill Regression Automation’), 0)
Mobile.delay(5)
Mobile.tapAtPosition((left + width) - 10, top + 10)