Can some one help me to know how do I swipe to next screen or tap on a button , in Samsung galaxy S6 will get two dot button, when tap on either one will change the screen from 1to 2 vice versa, but Katalon object spy is not able to read the properties of this two dot buttons, Please do find in screenshot…
How do I tap
How do I swipe
You can see on attached screenshot in Galaxy S6 I have go to screen, From Home once I will tap on AppView button 1st screen will open(1in screenshot) then I can tap on dot or swipe left by hand to move to other screen, Similiraly from screen 2(2nd in screenshot) I can swipe right to come to the 1st screen.
SpyMobile or Recorder is not able to identify this two dots its coming out of frame.
So please do let me know how I can achieve this
Mobile height and weidth is 2560x1440. To move to other screen what value I should give in Swipe (x,x,x,x)
I tried a really simple example for swiping on the Android home screen, and this worked for me:
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
// Need to choose some apk to start things off
Mobile.startApplication('sometestapp.apk', true)
// Close the apk and get back to the home screen
Mobile.pressBack()
// Swiping right to left
Mobile.swipe(1200, 100, 10, 100)
// NOTE: if you're using an older version of Katalon Studio, the 3rd and 4th parameters are *relative* coordinates
// Mobile.swipe(1200, 100, -1000, 0)
// Swiping left to right (the 3rd and 4th parameters are *relative* coordinates to the starting point)
Mobile.swipe(10, 100, 1200, 100)
// NOTE: if you're using an older version of Katalon Studio, the 3rd and 4th parameters are *relative* coordinates
// Mobile.swipe(10, 100, 1000, 0)
Mobile.delay(10)
Mobile.closeApplication()
Thanks Chris for the help, Still I am unable to make it work, Horizontal swipe is working when I open the Chrom browser with long page then able to swipe but
When list of icon open and I need to swipe from right to left or left to right not able to swipe don’t know why.
Hey @ehtimadi and @Chris_Trevarthen!
I have the same problem just like @ehtimadi and I cannot continue my mobile automation tests because of this situation., please can you help us about this?
Hello @Dan_Bown!
My mobile devices are changing sizes for my automation tests. That’s why I’m looking for a more effective way. Is there a function in Katalon that gives the screen location of an object? Can you help with this?
I can provide another document that describes swiping up and down but should be a good approach to scrolling/swiping in any direction (with any size screen). You say you’re looking for ‘location of an object’ though - that is not what a swipe does, it is not looking for an object at all, just two sets of coordinates. To move a screen to the right, you move your finger from right-to-left and you just need to tell Katalon where your swipe should start and finish.
This document also uses Mobile.getDeviceWidth() to get your device’s actual width, which might be more robust than providing a number in pixels that may change as your devices change. Handling Vertical Swipe in Mobile Automation | Katalon Docs
Hey @Dan_Bown!
I am attaching a photo of the situation in this comment that I want to do. In my test scenario, I need to remove the product with the delete button that comes after swiping a specific object to the left. Is there a sample code I can use for this?
I think I see what you are saying now, you need to swipe a specific element to trigger/reveal a new option called ‘Delete’? You probably need to look at the Katalon mobile keywords available in order to (I guess):
identify the correct element
get element top position (gives your ‘y’ coordinate)
get element left position (gives your ‘x’ coordinate)
get element width
get element height
work out the coordinates of your element
swipe, based on the coordinates obtained
Click the ‘Delete’ element
I don’t have any examples personally but perhaps someone here has a keyword for such a job?
Thanks a lot @Dan_Bown I will try it! If i can handle it, i will share the solution until then if anyone has a exact solution please help us about this situtation