Upload files for native mobile application
To upload files to a native mobile application of TestCloud, you can use the pushFile
method.
The keyword is only available for Android devices.
On Android, you can push files to these folders:
/sdcard/Download/
/sdcard/Pictures
/sdcard/Android/data/<app_package>
driver.pushFile("/sdcard/Download/sample.jpg", new File("/Users/katalonuser/Desktop/sample.png"));
Sample code:
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory
import io.appium.java_client.AppiumDriver
String localPath = new File(RunConfiguration.getProjectDir() + '/' + 'Data Files/puppy.png').getCanonicalPath()
AppiumDriver<?> driver = MobileDriverFactory.getDriver()
driver.pushFile('/sdcard/Pictures/puppy.png', new File(localPath))