I can't find the correct "X" and "Y" coordinate. when I enter the "X" and "Y" coordinate it will scroll the top menu bar.now I am using tablet phone.
Asked
Active
Viewed 652 times
0
-
I want to swipe the page. – Krishna Sagar Jan 30 '18 at 08:13
2 Answers
1
This might help for iOS swipe function
https://medium.com/@manishboricha308/ios-mobile-swipe-action-in-katalon-studio-4911199679e
For Android you can create another @Keyword custom
@Keyword
def swipeLeft(){
TouchAction touch = new TouchAction(getCurrentSessionMobileDriver())
int device_Height, device_Width
device_Height = Mobile.getDeviceHeight()
println device_Height
device_Width = Mobile.getDeviceWidth()
println device_Width
int midheight = device_Height/2
println midheight
int midwidth = device_Width/2
println midwidth
int startX,startY,endX,endY
startX = device_Width-100
startY = midheight
endX = -startX
endY = 0
Mobile.swipe(startX,startY,endX,endY)
touch.tap(startX, startY).perform()
}

Manish Boricha
- 61
- 1
- 4
-
Thanks for the given code, @Manish, I will apply this code, and give you the update on it. – Krishna Sagar May 24 '18 at 12:39
0
When You SpyMobile Your device, and mark object You want to swipe or scroll on You will notice properties window filed. There are X and Y also Height (H) and Width (W). X and Y are absolute co-ordinates to the top left corner of the object. H and W are the size of an object. So You do a simple calculation to see co-ordinates for rest of corners of the object. With this You know space You want to swipe or scroll on.
Hope it works for You.

Jatoonema
- 1
- 2